Searched refs:substream (Results 1 - 200 of 533) sorted by relevance

123

/linux-4.1.27/sound/core/
H A Dpcm_timer.c32 void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) snd_pcm_timer_resolution_change() argument
35 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_timer_resolution_change()
56 pcm_err(substream->pcm, snd_pcm_timer_resolution_change()
67 struct snd_pcm_substream *substream; snd_pcm_timer_resolution() local
69 substream = timer->private_data; snd_pcm_timer_resolution()
70 return substream->runtime ? substream->runtime->timer_resolution : 0; snd_pcm_timer_resolution()
75 struct snd_pcm_substream *substream; snd_pcm_timer_start() local
77 substream = snd_timer_chip(timer); snd_pcm_timer_start()
78 substream->timer_running = 1; snd_pcm_timer_start()
84 struct snd_pcm_substream *substream; snd_pcm_timer_stop() local
86 substream = snd_timer_chip(timer); snd_pcm_timer_stop()
87 substream->timer_running = 0; snd_pcm_timer_stop()
107 struct snd_pcm_substream *substream = timer->private_data; snd_pcm_timer_free() local
108 substream->timer = NULL; snd_pcm_timer_free()
111 void snd_pcm_timer_init(struct snd_pcm_substream *substream) snd_pcm_timer_init() argument
118 tid.card = substream->pcm->card->number; snd_pcm_timer_init()
119 tid.device = substream->pcm->device; snd_pcm_timer_init()
120 tid.subdevice = (substream->number << 1) | (substream->stream & 1); snd_pcm_timer_init()
121 if (snd_timer_new(substream->pcm->card, "PCM", &tid, &timer) < 0) snd_pcm_timer_init()
124 substream->stream == SNDRV_PCM_STREAM_CAPTURE ? snd_pcm_timer_init()
132 timer->private_data = substream; snd_pcm_timer_init()
134 substream->timer = timer; snd_pcm_timer_init()
137 void snd_pcm_timer_done(struct snd_pcm_substream *substream) snd_pcm_timer_done() argument
139 if (substream->timer) { snd_pcm_timer_done()
140 snd_device_free(substream->pcm->card, substream->timer); snd_pcm_timer_done()
141 substream->timer = NULL; snd_pcm_timer_done()
H A Dpcm_native.c63 static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
65 static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
91 * @substream: PCM substream
94 * flag of the given substream. This also takes the global link rw lock
97 void snd_pcm_stream_lock(struct snd_pcm_substream *substream) snd_pcm_stream_lock() argument
99 if (substream->pcm->nonatomic) { snd_pcm_stream_lock()
101 mutex_lock(&substream->self_group.mutex); snd_pcm_stream_lock()
104 spin_lock(&substream->self_group.lock); snd_pcm_stream_lock()
111 * @substream: PCM substream
115 void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) snd_pcm_stream_unlock() argument
117 if (substream->pcm->nonatomic) { snd_pcm_stream_unlock()
118 mutex_unlock(&substream->self_group.mutex); snd_pcm_stream_unlock()
121 spin_unlock(&substream->self_group.lock); snd_pcm_stream_unlock()
129 * @substream: PCM substream
135 void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) snd_pcm_stream_lock_irq() argument
137 if (!substream->pcm->nonatomic) snd_pcm_stream_lock_irq()
139 snd_pcm_stream_lock(substream); snd_pcm_stream_lock_irq()
145 * @substream: PCM substream
149 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream) snd_pcm_stream_unlock_irq() argument
151 snd_pcm_stream_unlock(substream); snd_pcm_stream_unlock_irq()
152 if (!substream->pcm->nonatomic) snd_pcm_stream_unlock_irq()
157 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream) _snd_pcm_stream_lock_irqsave() argument
160 if (!substream->pcm->nonatomic) _snd_pcm_stream_lock_irqsave()
162 snd_pcm_stream_lock(substream); _snd_pcm_stream_lock_irqsave()
169 * @substream: PCM substream
174 void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream, snd_pcm_stream_unlock_irqrestore() argument
177 snd_pcm_stream_unlock(substream); snd_pcm_stream_unlock_irqrestore()
178 if (!substream->pcm->nonatomic) snd_pcm_stream_unlock_irqrestore()
197 int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info) snd_pcm_info() argument
200 struct snd_pcm *pcm = substream->pcm; snd_pcm_info()
201 struct snd_pcm_str *pstr = substream->pstr; snd_pcm_info()
206 info->stream = substream->stream; snd_pcm_info()
207 info->subdevice = substream->number; snd_pcm_info()
214 strlcpy(info->subname, substream->name, sizeof(info->subname)); snd_pcm_info()
215 runtime = substream->runtime; snd_pcm_info()
219 substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_INFO, info); snd_pcm_info()
224 int snd_pcm_info_user(struct snd_pcm_substream *substream, snd_pcm_info_user() argument
233 err = snd_pcm_info(substream, info); snd_pcm_info_user()
242 static bool hw_support_mmap(struct snd_pcm_substream *substream) hw_support_mmap() argument
244 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP)) hw_support_mmap()
250 if (!substream->ops->mmap && hw_support_mmap()
251 substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) hw_support_mmap()
280 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, snd_pcm_hw_refine() argument
287 struct snd_pcm_hw_constraints *constrs = &substream->runtime->hw_constraints; snd_pcm_hw_refine()
433 hw = &substream->runtime->hw; snd_pcm_hw_refine()
437 if (!hw_support_mmap(substream)) snd_pcm_hw_refine()
446 changed = substream->ops->ioctl(substream, snd_pcm_hw_refine()
458 static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream, snd_pcm_hw_refine_user() argument
468 err = snd_pcm_hw_refine(substream, params); snd_pcm_hw_refine_user()
493 static void snd_pcm_set_state(struct snd_pcm_substream *substream, int state) snd_pcm_set_state() argument
495 snd_pcm_stream_lock_irq(substream); snd_pcm_set_state()
496 if (substream->runtime->status->state != SNDRV_PCM_STATE_DISCONNECTED) snd_pcm_set_state()
497 substream->runtime->status->state = state; snd_pcm_set_state()
498 snd_pcm_stream_unlock_irq(substream); snd_pcm_set_state()
501 static int snd_pcm_hw_params(struct snd_pcm_substream *substream, snd_pcm_hw_params() argument
509 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_hw_params()
511 runtime = substream->runtime; snd_pcm_hw_params()
512 snd_pcm_stream_lock_irq(substream); snd_pcm_hw_params()
519 snd_pcm_stream_unlock_irq(substream); snd_pcm_hw_params()
522 snd_pcm_stream_unlock_irq(substream); snd_pcm_hw_params()
524 if (!substream->oss.oss) snd_pcm_hw_params()
526 if (atomic_read(&substream->mmap_count)) snd_pcm_hw_params()
530 err = snd_pcm_hw_refine(substream, params); snd_pcm_hw_params()
534 err = snd_pcm_hw_params_choose(substream, params); snd_pcm_hw_params()
538 if (substream->ops->hw_params != NULL) { snd_pcm_hw_params()
539 err = substream->ops->hw_params(substream, params); snd_pcm_hw_params()
583 snd_pcm_timer_resolution_change(substream); snd_pcm_hw_params()
584 snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_hw_params()
586 if (pm_qos_request_active(&substream->latency_pm_qos_req)) snd_pcm_hw_params()
587 pm_qos_remove_request(&substream->latency_pm_qos_req); snd_pcm_hw_params()
589 pm_qos_add_request(&substream->latency_pm_qos_req, snd_pcm_hw_params()
596 snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); snd_pcm_hw_params()
597 if (substream->ops->hw_free != NULL) snd_pcm_hw_params()
598 substream->ops->hw_free(substream); snd_pcm_hw_params()
602 static int snd_pcm_hw_params_user(struct snd_pcm_substream *substream, snd_pcm_hw_params_user() argument
612 err = snd_pcm_hw_params(substream, params); snd_pcm_hw_params_user()
622 static int snd_pcm_hw_free(struct snd_pcm_substream *substream) snd_pcm_hw_free() argument
627 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_hw_free()
629 runtime = substream->runtime; snd_pcm_hw_free()
630 snd_pcm_stream_lock_irq(substream); snd_pcm_hw_free()
636 snd_pcm_stream_unlock_irq(substream); snd_pcm_hw_free()
639 snd_pcm_stream_unlock_irq(substream); snd_pcm_hw_free()
640 if (atomic_read(&substream->mmap_count)) snd_pcm_hw_free()
642 if (substream->ops->hw_free) snd_pcm_hw_free()
643 result = substream->ops->hw_free(substream); snd_pcm_hw_free()
644 snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); snd_pcm_hw_free()
645 pm_qos_remove_request(&substream->latency_pm_qos_req); snd_pcm_hw_free()
649 static int snd_pcm_sw_params(struct snd_pcm_substream *substream, snd_pcm_sw_params() argument
655 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_sw_params()
657 runtime = substream->runtime; snd_pcm_sw_params()
658 snd_pcm_stream_lock_irq(substream); snd_pcm_sw_params()
660 snd_pcm_stream_unlock_irq(substream); snd_pcm_sw_params()
663 snd_pcm_stream_unlock_irq(substream); snd_pcm_sw_params()
682 snd_pcm_stream_lock_irq(substream); snd_pcm_sw_params()
693 if (snd_pcm_running(substream)) { snd_pcm_sw_params()
694 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_pcm_sw_params()
696 snd_pcm_playback_silence(substream, ULONG_MAX); snd_pcm_sw_params()
697 err = snd_pcm_update_state(substream, runtime); snd_pcm_sw_params()
699 snd_pcm_stream_unlock_irq(substream); snd_pcm_sw_params()
703 static int snd_pcm_sw_params_user(struct snd_pcm_substream *substream, snd_pcm_sw_params_user() argument
710 err = snd_pcm_sw_params(substream, &params); snd_pcm_sw_params_user()
716 int snd_pcm_status(struct snd_pcm_substream *substream, snd_pcm_status() argument
719 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_status()
721 snd_pcm_stream_lock_irq(substream); snd_pcm_status()
744 if (snd_pcm_running(substream)) { snd_pcm_status()
745 snd_pcm_update_hw_ptr(substream); snd_pcm_status()
767 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_pcm_status()
787 snd_pcm_stream_unlock_irq(substream); snd_pcm_status()
791 static int snd_pcm_status_user(struct snd_pcm_substream *substream, snd_pcm_status_user() argument
807 res = snd_pcm_status(substream, &status); snd_pcm_status_user()
815 static int snd_pcm_channel_info(struct snd_pcm_substream *substream, snd_pcm_channel_info() argument
822 runtime = substream->runtime; snd_pcm_channel_info()
823 snd_pcm_stream_lock_irq(substream); snd_pcm_channel_info()
825 snd_pcm_stream_unlock_irq(substream); snd_pcm_channel_info()
828 snd_pcm_stream_unlock_irq(substream); snd_pcm_channel_info()
833 return substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_CHANNEL_INFO, info); snd_pcm_channel_info()
836 static int snd_pcm_channel_info_user(struct snd_pcm_substream *substream, snd_pcm_channel_info_user() argument
844 res = snd_pcm_channel_info(substream, &info); snd_pcm_channel_info_user()
852 static void snd_pcm_trigger_tstamp(struct snd_pcm_substream *substream) snd_pcm_trigger_tstamp() argument
854 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_trigger_tstamp()
857 if (runtime->trigger_master == substream) { snd_pcm_trigger_tstamp()
868 int (*pre_action)(struct snd_pcm_substream *substream, int state);
869 int (*do_action)(struct snd_pcm_substream *substream, int state);
870 void (*undo_action)(struct snd_pcm_substream *substream, int state);
871 void (*post_action)(struct snd_pcm_substream *substream, int state);
880 struct snd_pcm_substream *substream, snd_pcm_action_group()
887 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
888 if (do_lock && s != substream) { snd_pcm_group_for_each_entry()
899 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
903 snd_pcm_group_for_each_entry(s1, substream) { snd_pcm_group_for_each_entry()
913 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
919 snd_pcm_group_for_each_entry(s1, substream) { snd_pcm_group_for_each_entry()
920 if (s1 != substream) { snd_pcm_group_for_each_entry()
937 struct snd_pcm_substream *substream, snd_pcm_action_single()
942 res = ops->pre_action(substream, state); snd_pcm_action_single()
945 res = ops->do_action(substream, state); snd_pcm_action_single()
947 ops->post_action(substream, state); snd_pcm_action_single()
949 ops->undo_action(substream, state); snd_pcm_action_single()
957 struct snd_pcm_substream *substream, snd_pcm_action()
962 if (!snd_pcm_stream_linked(substream)) snd_pcm_action()
963 return snd_pcm_action_single(ops, substream, state); snd_pcm_action()
965 if (substream->pcm->nonatomic) { snd_pcm_action()
966 if (!mutex_trylock(&substream->group->mutex)) { snd_pcm_action()
967 mutex_unlock(&substream->self_group.mutex); snd_pcm_action()
968 mutex_lock(&substream->group->mutex); snd_pcm_action()
969 mutex_lock(&substream->self_group.mutex); snd_pcm_action()
971 res = snd_pcm_action_group(ops, substream, state, 1); snd_pcm_action()
972 mutex_unlock(&substream->group->mutex); snd_pcm_action()
974 if (!spin_trylock(&substream->group->lock)) { snd_pcm_action()
975 spin_unlock(&substream->self_group.lock); snd_pcm_action()
976 spin_lock(&substream->group->lock); snd_pcm_action()
977 spin_lock(&substream->self_group.lock); snd_pcm_action()
979 res = snd_pcm_action_group(ops, substream, state, 1); snd_pcm_action()
980 spin_unlock(&substream->group->lock); snd_pcm_action()
989 struct snd_pcm_substream *substream, snd_pcm_action_lock_irq()
994 snd_pcm_stream_lock_irq(substream); snd_pcm_action_lock_irq()
995 res = snd_pcm_action(ops, substream, state); snd_pcm_action_lock_irq()
996 snd_pcm_stream_unlock_irq(substream); snd_pcm_action_lock_irq()
1003 struct snd_pcm_substream *substream, snd_pcm_action_nonatomic()
1009 if (snd_pcm_stream_linked(substream)) snd_pcm_action_nonatomic()
1010 res = snd_pcm_action_group(ops, substream, state, 0); snd_pcm_action_nonatomic()
1012 res = snd_pcm_action_single(ops, substream, state); snd_pcm_action_nonatomic()
1020 static int snd_pcm_pre_start(struct snd_pcm_substream *substream, int state) snd_pcm_pre_start() argument
1022 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_start()
1025 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_pcm_pre_start()
1026 !snd_pcm_playback_data(substream)) snd_pcm_pre_start()
1029 runtime->trigger_master = substream; snd_pcm_pre_start()
1033 static int snd_pcm_do_start(struct snd_pcm_substream *substream, int state) snd_pcm_do_start() argument
1035 if (substream->runtime->trigger_master != substream) snd_pcm_do_start()
1037 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START); snd_pcm_do_start()
1040 static void snd_pcm_undo_start(struct snd_pcm_substream *substream, int state) snd_pcm_undo_start() argument
1042 if (substream->runtime->trigger_master == substream) snd_pcm_undo_start()
1043 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); snd_pcm_undo_start()
1046 static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state) snd_pcm_post_start() argument
1048 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_start()
1049 snd_pcm_trigger_tstamp(substream); snd_pcm_post_start()
1054 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_pcm_post_start()
1056 snd_pcm_playback_silence(substream, ULONG_MAX); snd_pcm_post_start()
1057 if (substream->timer) snd_pcm_post_start()
1058 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTART, snd_pcm_post_start()
1071 * @substream: the PCM substream instance
1075 int snd_pcm_start(struct snd_pcm_substream *substream) snd_pcm_start() argument
1077 return snd_pcm_action(&snd_pcm_action_start, substream, snd_pcm_start()
1084 static int snd_pcm_pre_stop(struct snd_pcm_substream *substream, int state) snd_pcm_pre_stop() argument
1086 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_stop()
1089 runtime->trigger_master = substream; snd_pcm_pre_stop()
1093 static int snd_pcm_do_stop(struct snd_pcm_substream *substream, int state) snd_pcm_do_stop() argument
1095 if (substream->runtime->trigger_master == substream && snd_pcm_do_stop()
1096 snd_pcm_running(substream)) snd_pcm_do_stop()
1097 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); snd_pcm_do_stop()
1101 static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state) snd_pcm_post_stop() argument
1103 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_stop()
1105 snd_pcm_trigger_tstamp(substream); snd_pcm_post_stop()
1107 if (substream->timer) snd_pcm_post_stop()
1108 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTOP, snd_pcm_post_stop()
1122 * snd_pcm_stop - try to stop all running streams in the substream group
1123 * @substream: the PCM substream instance
1130 int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t state) snd_pcm_stop() argument
1132 return snd_pcm_action(&snd_pcm_action_stop, substream, state); snd_pcm_stop()
1139 * @substream: the PCM substream
1146 int snd_pcm_drain_done(struct snd_pcm_substream *substream) snd_pcm_drain_done() argument
1148 return snd_pcm_action_single(&snd_pcm_action_stop, substream, snd_pcm_drain_done()
1154 * @substream: the PCM substream instance
1156 * This stops the given running substream (and all linked substreams) as XRUN.
1157 * Unlike snd_pcm_stop(), this function takes the substream lock by itself.
1161 int snd_pcm_stop_xrun(struct snd_pcm_substream *substream) snd_pcm_stop_xrun() argument
1166 snd_pcm_stream_lock_irqsave(substream, flags); snd_pcm_stop_xrun()
1167 if (snd_pcm_running(substream)) snd_pcm_stop_xrun()
1168 ret = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); snd_pcm_stop_xrun()
1169 snd_pcm_stream_unlock_irqrestore(substream, flags); snd_pcm_stop_xrun()
1177 static int snd_pcm_pre_pause(struct snd_pcm_substream *substream, int push) snd_pcm_pre_pause() argument
1179 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_pause()
1187 runtime->trigger_master = substream; snd_pcm_pre_pause()
1191 static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push) snd_pcm_do_pause() argument
1193 if (substream->runtime->trigger_master != substream) snd_pcm_do_pause()
1198 snd_pcm_update_hw_ptr(substream); snd_pcm_do_pause()
1203 substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000; snd_pcm_do_pause()
1204 return substream->ops->trigger(substream, snd_pcm_do_pause()
1209 static void snd_pcm_undo_pause(struct snd_pcm_substream *substream, int push) snd_pcm_undo_pause() argument
1211 if (substream->runtime->trigger_master == substream) snd_pcm_undo_pause()
1212 substream->ops->trigger(substream, snd_pcm_undo_pause()
1217 static void snd_pcm_post_pause(struct snd_pcm_substream *substream, int push) snd_pcm_post_pause() argument
1219 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_pause()
1220 snd_pcm_trigger_tstamp(substream); snd_pcm_post_pause()
1223 if (substream->timer) snd_pcm_post_pause()
1224 snd_timer_notify(substream->timer, snd_pcm_post_pause()
1231 if (substream->timer) snd_pcm_post_pause()
1232 snd_timer_notify(substream->timer, snd_pcm_post_pause()
1248 static int snd_pcm_pause(struct snd_pcm_substream *substream, int push) snd_pcm_pause() argument
1250 return snd_pcm_action(&snd_pcm_action_pause, substream, push); snd_pcm_pause()
1256 static int snd_pcm_pre_suspend(struct snd_pcm_substream *substream, int state) snd_pcm_pre_suspend() argument
1258 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_suspend()
1261 runtime->trigger_master = substream; snd_pcm_pre_suspend()
1265 static int snd_pcm_do_suspend(struct snd_pcm_substream *substream, int state) snd_pcm_do_suspend() argument
1267 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_suspend()
1268 if (runtime->trigger_master != substream) snd_pcm_do_suspend()
1270 if (! snd_pcm_running(substream)) snd_pcm_do_suspend()
1272 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND); snd_pcm_do_suspend()
1276 static void snd_pcm_post_suspend(struct snd_pcm_substream *substream, int state) snd_pcm_post_suspend() argument
1278 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_suspend()
1279 snd_pcm_trigger_tstamp(substream); snd_pcm_post_suspend()
1282 if (substream->timer) snd_pcm_post_suspend()
1283 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSUSPEND, snd_pcm_post_suspend()
1297 * @substream: the PCM substream
1301 * Return: Zero if successful (or @substream is %NULL), or a negative error
1304 int snd_pcm_suspend(struct snd_pcm_substream *substream) snd_pcm_suspend() argument
1309 if (! substream) snd_pcm_suspend()
1312 snd_pcm_stream_lock_irqsave(substream, flags); snd_pcm_suspend()
1313 err = snd_pcm_action(&snd_pcm_action_suspend, substream, 0); snd_pcm_suspend()
1314 snd_pcm_stream_unlock_irqrestore(substream, flags); snd_pcm_suspend()
1330 struct snd_pcm_substream *substream; snd_pcm_suspend_all() local
1337 for (substream = pcm->streams[stream].substream; snd_pcm_suspend_all()
1338 substream; substream = substream->next) { snd_pcm_suspend_all()
1340 if (substream->runtime == NULL) snd_pcm_suspend_all()
1342 err = snd_pcm_suspend(substream); snd_pcm_suspend_all()
1354 static int snd_pcm_pre_resume(struct snd_pcm_substream *substream, int state) snd_pcm_pre_resume() argument
1356 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_resume()
1359 runtime->trigger_master = substream; snd_pcm_pre_resume()
1363 static int snd_pcm_do_resume(struct snd_pcm_substream *substream, int state) snd_pcm_do_resume() argument
1365 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_resume()
1366 if (runtime->trigger_master != substream) snd_pcm_do_resume()
1371 substream->stream != SNDRV_PCM_STREAM_PLAYBACK)) snd_pcm_do_resume()
1373 return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME); snd_pcm_do_resume()
1376 static void snd_pcm_undo_resume(struct snd_pcm_substream *substream, int state) snd_pcm_undo_resume() argument
1378 if (substream->runtime->trigger_master == substream && snd_pcm_undo_resume()
1379 snd_pcm_running(substream)) snd_pcm_undo_resume()
1380 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND); snd_pcm_undo_resume()
1383 static void snd_pcm_post_resume(struct snd_pcm_substream *substream, int state) snd_pcm_post_resume() argument
1385 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_resume()
1386 snd_pcm_trigger_tstamp(substream); snd_pcm_post_resume()
1388 if (substream->timer) snd_pcm_post_resume()
1389 snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, snd_pcm_post_resume()
1400 static int snd_pcm_resume(struct snd_pcm_substream *substream) snd_pcm_resume() argument
1402 struct snd_card *card = substream->pcm->card; snd_pcm_resume()
1407 res = snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0); snd_pcm_resume()
1414 static int snd_pcm_resume(struct snd_pcm_substream *substream) snd_pcm_resume() argument
1426 static int snd_pcm_xrun(struct snd_pcm_substream *substream) snd_pcm_xrun() argument
1428 struct snd_card *card = substream->pcm->card; snd_pcm_xrun()
1429 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_xrun()
1439 snd_pcm_stream_lock_irq(substream); snd_pcm_xrun()
1445 result = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); snd_pcm_xrun()
1450 snd_pcm_stream_unlock_irq(substream); snd_pcm_xrun()
1459 static int snd_pcm_pre_reset(struct snd_pcm_substream *substream, int state) snd_pcm_pre_reset() argument
1461 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_reset()
1473 static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state) snd_pcm_do_reset() argument
1475 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_reset()
1476 int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL); snd_pcm_do_reset()
1487 static void snd_pcm_post_reset(struct snd_pcm_substream *substream, int state) snd_pcm_post_reset() argument
1489 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_reset()
1491 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_pcm_post_reset()
1493 snd_pcm_playback_silence(substream, ULONG_MAX); snd_pcm_post_reset()
1502 static int snd_pcm_reset(struct snd_pcm_substream *substream) snd_pcm_reset() argument
1504 return snd_pcm_action_nonatomic(&snd_pcm_action_reset, substream, 0); snd_pcm_reset()
1511 static int snd_pcm_pre_prepare(struct snd_pcm_substream *substream, snd_pcm_pre_prepare() argument
1514 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_prepare()
1518 if (snd_pcm_running(substream)) snd_pcm_pre_prepare()
1520 substream->f_flags = f_flags; snd_pcm_pre_prepare()
1524 static int snd_pcm_do_prepare(struct snd_pcm_substream *substream, int state) snd_pcm_do_prepare() argument
1527 err = substream->ops->prepare(substream); snd_pcm_do_prepare()
1530 return snd_pcm_do_reset(substream, 0); snd_pcm_do_prepare()
1533 static void snd_pcm_post_prepare(struct snd_pcm_substream *substream, int state) snd_pcm_post_prepare() argument
1535 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_post_prepare()
1537 snd_pcm_set_state(substream, SNDRV_PCM_STATE_PREPARED); snd_pcm_post_prepare()
1547 * snd_pcm_prepare - prepare the PCM substream to be triggerable
1548 * @substream: the PCM substream instance
1553 static int snd_pcm_prepare(struct snd_pcm_substream *substream, snd_pcm_prepare() argument
1557 struct snd_card *card = substream->pcm->card; snd_pcm_prepare()
1563 f_flags = substream->f_flags; snd_pcm_prepare()
1568 substream, f_flags); snd_pcm_prepare()
1577 static int snd_pcm_pre_drain_init(struct snd_pcm_substream *substream, int state) snd_pcm_pre_drain_init() argument
1579 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_pre_drain_init()
1586 runtime->trigger_master = substream; snd_pcm_pre_drain_init()
1590 static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, int state) snd_pcm_do_drain_init() argument
1592 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_do_drain_init()
1593 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_pcm_do_drain_init()
1597 if (! snd_pcm_playback_empty(substream)) { snd_pcm_do_drain_init()
1598 snd_pcm_do_start(substream, SNDRV_PCM_STATE_DRAINING); snd_pcm_do_drain_init()
1599 snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING); snd_pcm_do_drain_init()
1618 snd_pcm_do_stop(substream, new_state); snd_pcm_do_drain_init()
1619 snd_pcm_post_stop(substream, new_state); snd_pcm_do_drain_init()
1624 runtime->trigger_master == substream && snd_pcm_do_drain_init()
1626 return substream->ops->trigger(substream, snd_pcm_do_drain_init()
1632 static void snd_pcm_post_drain_init(struct snd_pcm_substream *substream, int state) snd_pcm_post_drain_init() argument
1642 static int snd_pcm_drop(struct snd_pcm_substream *substream);
1646 * When the substream is linked, sync until the draining of all playback streams
1651 static int snd_pcm_drain(struct snd_pcm_substream *substream, snd_pcm_drain() argument
1661 card = substream->pcm->card; snd_pcm_drain()
1662 runtime = substream->runtime; snd_pcm_drain()
1679 } else if (substream->f_flags & O_NONBLOCK) snd_pcm_drain()
1683 snd_pcm_stream_lock_irq(substream); snd_pcm_drain()
1686 snd_pcm_pause(substream, 0); snd_pcm_drain()
1689 result = snd_pcm_action(&snd_pcm_action_drain_init, substream, 0); snd_pcm_drain()
1705 /* find a substream to drain */ snd_pcm_drain()
1707 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1720 snd_pcm_stream_unlock_irq(substream);
1736 snd_pcm_stream_lock_irq(substream);
1743 if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
1746 dev_dbg(substream->pcm->card->dev,
1748 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
1756 snd_pcm_stream_unlock_irq(substream);
1768 static int snd_pcm_drop(struct snd_pcm_substream *substream) snd_pcm_drop() argument
1773 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_drop()
1775 runtime = substream->runtime; snd_pcm_drop()
1782 snd_pcm_stream_lock_irq(substream); snd_pcm_drop()
1785 snd_pcm_pause(substream, 0); snd_pcm_drop()
1787 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_drop()
1789 snd_pcm_stream_unlock_irq(substream); snd_pcm_drop()
1810 static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) snd_pcm_link() argument
1825 substream1 = pcm_file->substream; snd_pcm_link()
1833 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN || snd_pcm_link()
1834 substream->runtime->status->state != substream1->runtime->status->state || snd_pcm_link()
1835 substream->pcm->nonatomic != substream1->pcm->nonatomic) { snd_pcm_link()
1843 if (!snd_pcm_stream_linked(substream)) { snd_pcm_link()
1844 substream->group = group; snd_pcm_link()
1846 spin_lock_init(&substream->group->lock); snd_pcm_link()
1847 mutex_init(&substream->group->mutex); snd_pcm_link()
1848 INIT_LIST_HEAD(&substream->group->substreams); snd_pcm_link()
1849 list_add_tail(&substream->link_list, &substream->group->substreams); snd_pcm_link()
1850 substream->group->count = 1; snd_pcm_link()
1852 list_add_tail(&substream1->link_list, &substream->group->substreams); snd_pcm_link()
1853 substream->group->count++; snd_pcm_link()
1854 substream1->group = substream->group; snd_pcm_link()
1866 static void relink_to_local(struct snd_pcm_substream *substream) relink_to_local() argument
1868 substream->group = &substream->self_group; relink_to_local()
1869 INIT_LIST_HEAD(&substream->self_group.substreams); relink_to_local()
1870 list_add_tail(&substream->link_list, &substream->self_group.substreams); relink_to_local()
1873 static int snd_pcm_unlink(struct snd_pcm_substream *substream) snd_pcm_unlink() argument
1880 if (!snd_pcm_stream_linked(substream)) { snd_pcm_unlink()
1884 list_del(&substream->link_list); snd_pcm_unlink()
1885 substream->group->count--; snd_pcm_unlink()
1886 if (substream->group->count == 1) { /* detach the last stream, too */ snd_pcm_group_for_each_entry()
1887 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1891 kfree(substream->group);
1893 relink_to_local(substream);
2012 struct snd_pcm_substream *substream = rule->private; snd_pcm_hw_rule_buffer_bytes_max() local
2014 t.max = substream->buffer_bytes_max; snd_pcm_hw_rule_buffer_bytes_max()
2021 int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream) snd_pcm_hw_constraints_init() argument
2023 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hw_constraints_init()
2145 int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) snd_pcm_hw_constraints_complete() argument
2147 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hw_constraints_complete()
2156 if (hw_support_mmap(substream)) { snd_pcm_hw_constraints_complete()
2202 snd_pcm_hw_rule_buffer_bytes_max, substream, snd_pcm_hw_constraints_complete()
2228 static void pcm_release_private(struct snd_pcm_substream *substream) pcm_release_private() argument
2230 snd_pcm_unlink(substream); pcm_release_private()
2233 void snd_pcm_release_substream(struct snd_pcm_substream *substream) snd_pcm_release_substream() argument
2235 substream->ref_count--; snd_pcm_release_substream()
2236 if (substream->ref_count > 0) snd_pcm_release_substream()
2239 snd_pcm_drop(substream); snd_pcm_release_substream()
2240 if (substream->hw_opened) { snd_pcm_release_substream()
2241 if (substream->ops->hw_free != NULL) snd_pcm_release_substream()
2242 substream->ops->hw_free(substream); snd_pcm_release_substream()
2243 substream->ops->close(substream); snd_pcm_release_substream()
2244 substream->hw_opened = 0; snd_pcm_release_substream()
2246 if (pm_qos_request_active(&substream->latency_pm_qos_req)) snd_pcm_release_substream()
2247 pm_qos_remove_request(&substream->latency_pm_qos_req); snd_pcm_release_substream()
2248 if (substream->pcm_release) { snd_pcm_release_substream()
2249 substream->pcm_release(substream); snd_pcm_release_substream()
2250 substream->pcm_release = NULL; snd_pcm_release_substream()
2252 snd_pcm_detach_substream(substream); snd_pcm_release_substream()
2261 struct snd_pcm_substream *substream; snd_pcm_open_substream() local
2264 err = snd_pcm_attach_substream(pcm, stream, file, &substream); snd_pcm_open_substream()
2267 if (substream->ref_count > 1) { snd_pcm_open_substream()
2268 *rsubstream = substream; snd_pcm_open_substream()
2272 err = snd_pcm_hw_constraints_init(substream); snd_pcm_open_substream()
2278 if ((err = substream->ops->open(substream)) < 0) snd_pcm_open_substream()
2281 substream->hw_opened = 1; snd_pcm_open_substream()
2283 err = snd_pcm_hw_constraints_complete(substream); snd_pcm_open_substream()
2289 *rsubstream = substream; snd_pcm_open_substream()
2293 snd_pcm_release_substream(substream); snd_pcm_open_substream()
2304 struct snd_pcm_substream *substream; snd_pcm_open_file() local
2307 err = snd_pcm_open_substream(pcm, stream, file, &substream); snd_pcm_open_file()
2313 snd_pcm_release_substream(substream); snd_pcm_open_file()
2316 pcm_file->substream = substream; snd_pcm_open_file()
2317 if (substream->ref_count == 1) { snd_pcm_open_file()
2318 substream->file = pcm_file; snd_pcm_open_file()
2319 substream->pcm_release = pcm_release_private; snd_pcm_open_file()
2414 struct snd_pcm_substream *substream; snd_pcm_release() local
2418 substream = pcm_file->substream; snd_pcm_release()
2419 if (snd_BUG_ON(!substream)) snd_pcm_release()
2421 pcm = substream->pcm; snd_pcm_release()
2423 snd_pcm_release_substream(substream); snd_pcm_release()
2432 static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *substream, snd_pcm_playback_rewind() argument
2435 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_rewind()
2443 snd_pcm_stream_lock_irq(substream); snd_pcm_playback_rewind()
2449 if (snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_playback_rewind()
2476 snd_pcm_stream_unlock_irq(substream); snd_pcm_playback_rewind()
2480 static snd_pcm_sframes_t snd_pcm_capture_rewind(struct snd_pcm_substream *substream, snd_pcm_capture_rewind() argument
2483 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_rewind()
2491 snd_pcm_stream_lock_irq(substream); snd_pcm_capture_rewind()
2497 if (snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_capture_rewind()
2524 snd_pcm_stream_unlock_irq(substream); snd_pcm_capture_rewind()
2528 static snd_pcm_sframes_t snd_pcm_playback_forward(struct snd_pcm_substream *substream, snd_pcm_playback_forward() argument
2531 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_forward()
2539 snd_pcm_stream_lock_irq(substream); snd_pcm_playback_forward()
2546 if (snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_playback_forward()
2573 snd_pcm_stream_unlock_irq(substream); snd_pcm_playback_forward()
2577 static snd_pcm_sframes_t snd_pcm_capture_forward(struct snd_pcm_substream *substream, snd_pcm_capture_forward() argument
2580 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_forward()
2588 snd_pcm_stream_lock_irq(substream); snd_pcm_capture_forward()
2595 if (snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_capture_forward()
2622 snd_pcm_stream_unlock_irq(substream); snd_pcm_capture_forward()
2626 static int snd_pcm_hwsync(struct snd_pcm_substream *substream) snd_pcm_hwsync() argument
2628 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_hwsync()
2631 snd_pcm_stream_lock_irq(substream); snd_pcm_hwsync()
2634 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) snd_pcm_hwsync()
2638 if ((err = snd_pcm_update_hw_ptr(substream)) < 0) snd_pcm_hwsync()
2653 snd_pcm_stream_unlock_irq(substream); snd_pcm_hwsync()
2657 static int snd_pcm_delay(struct snd_pcm_substream *substream, snd_pcm_delay() argument
2660 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_delay()
2664 snd_pcm_stream_lock_irq(substream); snd_pcm_delay()
2667 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) snd_pcm_delay()
2671 if ((err = snd_pcm_update_hw_ptr(substream)) < 0) snd_pcm_delay()
2677 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_delay()
2691 snd_pcm_stream_unlock_irq(substream); snd_pcm_delay()
2698 static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream, snd_pcm_sync_ptr() argument
2701 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_sync_ptr()
2715 err = snd_pcm_hwsync(substream); snd_pcm_sync_ptr()
2719 snd_pcm_stream_lock_irq(substream); snd_pcm_sync_ptr()
2732 snd_pcm_stream_unlock_irq(substream); snd_pcm_sync_ptr()
2738 static int snd_pcm_tstamp(struct snd_pcm_substream *substream, int __user *_arg) snd_pcm_tstamp() argument
2740 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_tstamp()
2752 struct snd_pcm_substream *substream, snd_pcm_common_ioctl1()
2759 return snd_pcm_info_user(substream, arg); snd_pcm_common_ioctl1()
2763 return snd_pcm_tstamp(substream, arg); snd_pcm_common_ioctl1()
2765 return snd_pcm_hw_refine_user(substream, arg); snd_pcm_common_ioctl1()
2767 return snd_pcm_hw_params_user(substream, arg); snd_pcm_common_ioctl1()
2769 return snd_pcm_hw_free(substream); snd_pcm_common_ioctl1()
2771 return snd_pcm_sw_params_user(substream, arg); snd_pcm_common_ioctl1()
2773 return snd_pcm_status_user(substream, arg, false); snd_pcm_common_ioctl1()
2775 return snd_pcm_status_user(substream, arg, true); snd_pcm_common_ioctl1()
2777 return snd_pcm_channel_info_user(substream, arg); snd_pcm_common_ioctl1()
2779 return snd_pcm_prepare(substream, file); snd_pcm_common_ioctl1()
2781 return snd_pcm_reset(substream); snd_pcm_common_ioctl1()
2783 return snd_pcm_action_lock_irq(&snd_pcm_action_start, substream, SNDRV_PCM_STATE_RUNNING); snd_pcm_common_ioctl1()
2785 return snd_pcm_link(substream, (int)(unsigned long) arg); snd_pcm_common_ioctl1()
2787 return snd_pcm_unlink(substream); snd_pcm_common_ioctl1()
2789 return snd_pcm_resume(substream); snd_pcm_common_ioctl1()
2791 return snd_pcm_xrun(substream); snd_pcm_common_ioctl1()
2793 return snd_pcm_hwsync(substream); snd_pcm_common_ioctl1()
2795 return snd_pcm_delay(substream, arg); snd_pcm_common_ioctl1()
2797 return snd_pcm_sync_ptr(substream, arg); snd_pcm_common_ioctl1()
2800 return snd_pcm_hw_refine_old_user(substream, arg); snd_pcm_common_ioctl1()
2802 return snd_pcm_hw_params_old_user(substream, arg); snd_pcm_common_ioctl1()
2805 return snd_pcm_drain(substream, file); snd_pcm_common_ioctl1()
2807 return snd_pcm_drop(substream); snd_pcm_common_ioctl1()
2811 snd_pcm_stream_lock_irq(substream); snd_pcm_common_ioctl1()
2812 res = snd_pcm_pause(substream, (int)(unsigned long)arg); snd_pcm_common_ioctl1()
2813 snd_pcm_stream_unlock_irq(substream); snd_pcm_common_ioctl1()
2817 pcm_dbg(substream->pcm, "unknown ioctl = 0x%x\n", cmd); snd_pcm_common_ioctl1()
2822 struct snd_pcm_substream *substream, snd_pcm_playback_ioctl1()
2825 if (snd_BUG_ON(!substream)) snd_pcm_playback_ioctl1()
2827 if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_PLAYBACK)) snd_pcm_playback_ioctl1()
2834 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ioctl1()
2842 result = snd_pcm_lib_write(substream, xferi.buf, xferi.frames); snd_pcm_playback_ioctl1()
2850 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ioctl1()
2866 result = snd_pcm_lib_writev(substream, bufs, xfern.frames); snd_pcm_playback_ioctl1()
2880 result = snd_pcm_playback_rewind(substream, frames); snd_pcm_playback_ioctl1()
2893 result = snd_pcm_playback_forward(substream, frames); snd_pcm_playback_ioctl1()
2898 return snd_pcm_common_ioctl1(file, substream, cmd, arg); snd_pcm_playback_ioctl1()
2902 struct snd_pcm_substream *substream, snd_pcm_capture_ioctl1()
2905 if (snd_BUG_ON(!substream)) snd_pcm_capture_ioctl1()
2907 if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_CAPTURE)) snd_pcm_capture_ioctl1()
2914 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ioctl1()
2922 result = snd_pcm_lib_read(substream, xferi.buf, xferi.frames); snd_pcm_capture_ioctl1()
2930 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ioctl1()
2946 result = snd_pcm_lib_readv(substream, bufs, xfern.frames); snd_pcm_capture_ioctl1()
2960 result = snd_pcm_capture_rewind(substream, frames); snd_pcm_capture_ioctl1()
2973 result = snd_pcm_capture_forward(substream, frames); snd_pcm_capture_ioctl1()
2978 return snd_pcm_common_ioctl1(file, substream, cmd, arg); snd_pcm_capture_ioctl1()
2991 return snd_pcm_playback_ioctl1(file, pcm_file->substream, cmd, snd_pcm_playback_ioctl()
3005 return snd_pcm_capture_ioctl1(file, pcm_file->substream, cmd, snd_pcm_capture_ioctl()
3009 int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, snd_pcm_kernel_ioctl() argument
3016 switch (substream->stream) { snd_pcm_kernel_ioctl()
3018 result = snd_pcm_playback_ioctl1(NULL, substream, cmd, snd_pcm_kernel_ioctl()
3022 result = snd_pcm_capture_ioctl1(NULL, substream, cmd, snd_pcm_kernel_ioctl()
3039 struct snd_pcm_substream *substream; snd_pcm_read() local
3044 substream = pcm_file->substream; snd_pcm_read()
3045 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_read()
3047 runtime = substream->runtime; snd_pcm_read()
3053 result = snd_pcm_lib_read(substream, buf, count); snd_pcm_read()
3063 struct snd_pcm_substream *substream; snd_pcm_write() local
3068 substream = pcm_file->substream; snd_pcm_write()
3069 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_write()
3071 runtime = substream->runtime; snd_pcm_write()
3077 result = snd_pcm_lib_write(substream, buf, count); snd_pcm_write()
3086 struct snd_pcm_substream *substream; snd_pcm_readv() local
3094 substream = pcm_file->substream; snd_pcm_readv()
3095 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_readv()
3097 runtime = substream->runtime; snd_pcm_readv()
3112 result = snd_pcm_lib_readv(substream, bufs, frames); snd_pcm_readv()
3122 struct snd_pcm_substream *substream; snd_pcm_writev() local
3130 substream = pcm_file->substream; snd_pcm_writev()
3131 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_writev()
3133 runtime = substream->runtime; snd_pcm_writev()
3147 result = snd_pcm_lib_writev(substream, bufs, frames); snd_pcm_writev()
3157 struct snd_pcm_substream *substream; snd_pcm_playback_poll() local
3164 substream = pcm_file->substream; snd_pcm_playback_poll()
3165 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_playback_poll()
3167 runtime = substream->runtime; snd_pcm_playback_poll()
3171 snd_pcm_stream_lock_irq(substream); snd_pcm_playback_poll()
3189 snd_pcm_stream_unlock_irq(substream); snd_pcm_playback_poll()
3196 struct snd_pcm_substream *substream; snd_pcm_capture_poll() local
3203 substream = pcm_file->substream; snd_pcm_capture_poll()
3204 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_capture_poll()
3206 runtime = substream->runtime; snd_pcm_capture_poll()
3210 snd_pcm_stream_lock_irq(substream); snd_pcm_capture_poll()
3232 snd_pcm_stream_unlock_irq(substream); snd_pcm_capture_poll()
3251 struct snd_pcm_substream *substream = area->vm_private_data; snd_pcm_mmap_status_fault() local
3254 if (substream == NULL) snd_pcm_mmap_status_fault()
3256 runtime = substream->runtime; snd_pcm_mmap_status_fault()
3267 static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, snd_pcm_mmap_status() argument
3277 area->vm_private_data = substream; snd_pcm_mmap_status()
3288 struct snd_pcm_substream *substream = area->vm_private_data; snd_pcm_mmap_control_fault() local
3291 if (substream == NULL) snd_pcm_mmap_control_fault()
3293 runtime = substream->runtime; snd_pcm_mmap_control_fault()
3304 static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, snd_pcm_mmap_control() argument
3314 area->vm_private_data = substream; snd_pcm_mmap_control()
3322 static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, snd_pcm_mmap_status() argument
3327 static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, snd_pcm_mmap_control() argument
3335 snd_pcm_default_page_ops(struct snd_pcm_substream *substream, unsigned long ofs) snd_pcm_default_page_ops() argument
3337 void *vaddr = substream->runtime->dma_area + ofs; snd_pcm_default_page_ops()
3347 struct snd_pcm_substream *substream = area->vm_private_data; snd_pcm_mmap_data_fault() local
3353 if (substream == NULL) snd_pcm_mmap_data_fault()
3355 runtime = substream->runtime; snd_pcm_mmap_data_fault()
3360 if (substream->ops->page) snd_pcm_mmap_data_fault()
3361 page = substream->ops->page(substream, offset); snd_pcm_mmap_data_fault()
3363 page = snd_pcm_default_page_ops(substream, offset); snd_pcm_mmap_data_fault()
3388 * @substream: PCM substream
3394 int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, snd_pcm_lib_default_mmap() argument
3399 if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV_IRAM) { snd_pcm_lib_default_mmap()
3402 substream->dma_buffer.addr >> PAGE_SHIFT, snd_pcm_lib_default_mmap()
3407 if (!substream->ops->page && snd_pcm_lib_default_mmap()
3408 substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) snd_pcm_lib_default_mmap()
3409 return dma_mmap_coherent(substream->dma_buffer.dev.dev, snd_pcm_lib_default_mmap()
3411 substream->runtime->dma_area, snd_pcm_lib_default_mmap()
3412 substream->runtime->dma_addr, snd_pcm_lib_default_mmap()
3427 * @substream: PCM substream
3434 int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, snd_pcm_lib_mmap_iomem() argument
3437 struct snd_pcm_runtime *runtime = substream->runtime;; snd_pcm_lib_mmap_iomem()
3449 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, snd_pcm_mmap_data() argument
3458 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_pcm_mmap_data()
3465 runtime = substream->runtime; snd_pcm_mmap_data()
3482 area->vm_private_data = substream; snd_pcm_mmap_data()
3483 if (substream->ops->mmap) snd_pcm_mmap_data()
3484 err = substream->ops->mmap(substream, area); snd_pcm_mmap_data()
3486 err = snd_pcm_lib_default_mmap(substream, area); snd_pcm_mmap_data()
3488 atomic_inc(&substream->mmap_count); snd_pcm_mmap_data()
3497 struct snd_pcm_substream *substream; snd_pcm_mmap() local
3501 substream = pcm_file->substream; snd_pcm_mmap()
3502 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_mmap()
3510 return snd_pcm_mmap_status(substream, file, area); snd_pcm_mmap()
3514 return snd_pcm_mmap_control(substream, file, area); snd_pcm_mmap()
3516 return snd_pcm_mmap_data(substream, file, area); snd_pcm_mmap()
3524 struct snd_pcm_substream *substream; snd_pcm_fasync() local
3528 substream = pcm_file->substream; snd_pcm_fasync()
3529 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_fasync()
3531 runtime = substream->runtime; snd_pcm_fasync()
3590 static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream, snd_pcm_hw_refine_old_user() argument
3607 err = snd_pcm_hw_refine(substream, params); snd_pcm_hw_refine_old_user()
3620 static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream, snd_pcm_hw_params_old_user() argument
3637 err = snd_pcm_hw_params(substream, params); snd_pcm_hw_params_old_user()
3659 struct snd_pcm_substream *substream = pcm_file->substream; snd_pcm_get_unmapped_area() local
3660 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_get_unmapped_area()
879 snd_pcm_action_group(struct action_ops *ops, struct snd_pcm_substream *substream, int state, int do_lock) snd_pcm_action_group() argument
936 snd_pcm_action_single(struct action_ops *ops, struct snd_pcm_substream *substream, int state) snd_pcm_action_single() argument
956 snd_pcm_action(struct action_ops *ops, struct snd_pcm_substream *substream, int state) snd_pcm_action() argument
988 snd_pcm_action_lock_irq(struct action_ops *ops, struct snd_pcm_substream *substream, int state) snd_pcm_action_lock_irq() argument
1002 snd_pcm_action_nonatomic(struct action_ops *ops, struct snd_pcm_substream *substream, int state) snd_pcm_action_nonatomic() argument
2751 snd_pcm_common_ioctl1(struct file *file, struct snd_pcm_substream *substream, unsigned int cmd, void __user *arg) snd_pcm_common_ioctl1() argument
2821 snd_pcm_playback_ioctl1(struct file *file, struct snd_pcm_substream *substream, unsigned int cmd, void __user *arg) snd_pcm_playback_ioctl1() argument
2901 snd_pcm_capture_ioctl1(struct file *file, struct snd_pcm_substream *substream, unsigned int cmd, void __user *arg) snd_pcm_capture_ioctl1() argument
H A Dpcm_memory.c51 static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t size) preallocate_pcm_pages() argument
53 struct snd_dma_buffer *dmab = &substream->dma_buffer; preallocate_pcm_pages()
68 substream->pcm->card->number, substream->pcm->device, preallocate_pcm_pages()
69 substream->stream ? 'c' : 'p', substream->number, preallocate_pcm_pages()
70 substream->pcm->name, orig_size); preallocate_pcm_pages()
77 static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream) snd_pcm_lib_preallocate_dma_free() argument
79 if (substream->dma_buffer.area == NULL) snd_pcm_lib_preallocate_dma_free()
81 snd_dma_free_pages(&substream->dma_buffer); snd_pcm_lib_preallocate_dma_free()
82 substream->dma_buffer.area = NULL; snd_pcm_lib_preallocate_dma_free()
86 * snd_pcm_lib_preallocate_free - release the preallocated buffer of the specified substream.
87 * @substream: the pcm substream instance
89 * Releases the pre-allocated buffer of the given substream.
93 int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) snd_pcm_lib_preallocate_free() argument
95 snd_pcm_lib_preallocate_dma_free(substream); snd_pcm_lib_preallocate_free()
97 snd_info_free_entry(substream->proc_prealloc_max_entry); snd_pcm_lib_preallocate_free()
98 substream->proc_prealloc_max_entry = NULL; snd_pcm_lib_preallocate_free()
99 snd_info_free_entry(substream->proc_prealloc_entry); snd_pcm_lib_preallocate_free()
100 substream->proc_prealloc_entry = NULL; snd_pcm_lib_preallocate_free()
115 struct snd_pcm_substream *substream; snd_pcm_lib_preallocate_free_for_all() local
119 for (substream = pcm->streams[stream].substream; substream; substream = substream->next) snd_pcm_lib_preallocate_free_for_all()
120 snd_pcm_lib_preallocate_free(substream); snd_pcm_lib_preallocate_free_for_all()
135 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_lib_preallocate_proc_read() local
136 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_buffer.bytes / 1024); snd_pcm_lib_preallocate_proc_read()
147 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_lib_preallocate_max_proc_read() local
148 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_max / 1024); snd_pcm_lib_preallocate_max_proc_read()
159 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_lib_preallocate_proc_write() local
164 if (substream->runtime) { snd_pcm_lib_preallocate_proc_write()
171 if ((size != 0 && size < 8192) || size > substream->dma_max) { snd_pcm_lib_preallocate_proc_write()
175 if (substream->dma_buffer.bytes == size) snd_pcm_lib_preallocate_proc_write()
178 new_dmab.dev = substream->dma_buffer.dev; snd_pcm_lib_preallocate_proc_write()
180 if (snd_dma_alloc_pages(substream->dma_buffer.dev.type, snd_pcm_lib_preallocate_proc_write()
181 substream->dma_buffer.dev.dev, snd_pcm_lib_preallocate_proc_write()
186 substream->buffer_bytes_max = size; snd_pcm_lib_preallocate_proc_write()
188 substream->buffer_bytes_max = UINT_MAX; snd_pcm_lib_preallocate_proc_write()
190 if (substream->dma_buffer.area) snd_pcm_lib_preallocate_proc_write()
191 snd_dma_free_pages(&substream->dma_buffer); snd_pcm_lib_preallocate_proc_write()
192 substream->dma_buffer = new_dmab; snd_pcm_lib_preallocate_proc_write()
198 static inline void preallocate_info_init(struct snd_pcm_substream *substream) preallocate_info_init() argument
202 if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc", substream->proc_root)) != NULL) { preallocate_info_init()
206 entry->private_data = substream; preallocate_info_init()
212 substream->proc_prealloc_entry = entry; preallocate_info_init()
213 if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc_max", substream->proc_root)) != NULL) { preallocate_info_init()
215 entry->private_data = substream; preallocate_info_init()
221 substream->proc_prealloc_max_entry = entry; preallocate_info_init()
229 * pre-allocate the buffer and create a proc file for the substream
231 static int snd_pcm_lib_preallocate_pages1(struct snd_pcm_substream *substream, snd_pcm_lib_preallocate_pages1() argument
235 if (size > 0 && preallocate_dma && substream->number < maximum_substreams) snd_pcm_lib_preallocate_pages1()
236 preallocate_pcm_pages(substream, size); snd_pcm_lib_preallocate_pages1()
238 if (substream->dma_buffer.bytes > 0) snd_pcm_lib_preallocate_pages1()
239 substream->buffer_bytes_max = substream->dma_buffer.bytes; snd_pcm_lib_preallocate_pages1()
240 substream->dma_max = max; snd_pcm_lib_preallocate_pages1()
241 preallocate_info_init(substream); snd_pcm_lib_preallocate_pages1()
248 * @substream: the pcm substream instance
258 int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, snd_pcm_lib_preallocate_pages() argument
262 substream->dma_buffer.dev.type = type; snd_pcm_lib_preallocate_pages()
263 substream->dma_buffer.dev.dev = data; snd_pcm_lib_preallocate_pages()
264 return snd_pcm_lib_preallocate_pages1(substream, size, max); snd_pcm_lib_preallocate_pages()
286 struct snd_pcm_substream *substream; snd_pcm_lib_preallocate_pages_for_all() local
290 for (substream = pcm->streams[stream].substream; substream; substream = substream->next) snd_pcm_lib_preallocate_pages_for_all()
291 if ((err = snd_pcm_lib_preallocate_pages(substream, type, data, size, max)) < 0) snd_pcm_lib_preallocate_pages_for_all()
301 * @substream: the pcm substream instance
308 struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) snd_pcm_sgbuf_ops_page() argument
310 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); snd_pcm_sgbuf_ops_page()
323 * @substream: the substream to allocate the DMA buffer to
332 int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) snd_pcm_lib_malloc_pages() argument
337 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_lib_malloc_pages()
339 if (snd_BUG_ON(substream->dma_buffer.dev.type == snd_pcm_lib_malloc_pages()
342 runtime = substream->runtime; snd_pcm_lib_malloc_pages()
352 snd_pcm_lib_free_pages(substream); snd_pcm_lib_malloc_pages()
354 if (substream->dma_buffer.area != NULL && snd_pcm_lib_malloc_pages()
355 substream->dma_buffer.bytes >= size) { snd_pcm_lib_malloc_pages()
356 dmab = &substream->dma_buffer; /* use the pre-allocated buffer */ snd_pcm_lib_malloc_pages()
361 dmab->dev = substream->dma_buffer.dev; snd_pcm_lib_malloc_pages()
362 if (snd_dma_alloc_pages(substream->dma_buffer.dev.type, snd_pcm_lib_malloc_pages()
363 substream->dma_buffer.dev.dev, snd_pcm_lib_malloc_pages()
369 snd_pcm_set_runtime_buffer(substream, dmab); snd_pcm_lib_malloc_pages()
378 * @substream: the substream to release the DMA buffer
384 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) snd_pcm_lib_free_pages() argument
388 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_lib_free_pages()
390 runtime = substream->runtime; snd_pcm_lib_free_pages()
393 if (runtime->dma_buffer_p != &substream->dma_buffer) { snd_pcm_lib_free_pages()
398 snd_pcm_set_runtime_buffer(substream, NULL); snd_pcm_lib_free_pages()
404 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, _snd_pcm_lib_alloc_vmalloc_buffer() argument
409 if (PCM_RUNTIME_CHECK(substream)) _snd_pcm_lib_alloc_vmalloc_buffer()
411 runtime = substream->runtime; _snd_pcm_lib_alloc_vmalloc_buffer()
427 * @substream: the substream with a buffer allocated by
432 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream) snd_pcm_lib_free_vmalloc_buffer() argument
436 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_lib_free_vmalloc_buffer()
438 runtime = substream->runtime; snd_pcm_lib_free_vmalloc_buffer()
447 * @substream: the substream with a buffer allocated by
455 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, snd_pcm_lib_get_vmalloc_page() argument
458 return vmalloc_to_page(substream->runtime->dma_area + offset); snd_pcm_lib_get_vmalloc_page()
H A Dpcm_trace.h11 TP_PROTO(struct snd_pcm_substream *substream, snd_pcm_uframes_t pos, bool irq),
12 TP_ARGS(substream, pos, irq),
27 __entry->card = (substream)->pcm->card->number;
28 __entry->device = (substream)->pcm->device;
29 __entry->number = (substream)->number;
30 __entry->stream = (substream)->stream;
32 __entry->period_size = (substream)->runtime->period_size;
33 __entry->buffer_size = (substream)->runtime->buffer_size;
34 __entry->old_hw_ptr = (substream)->runtime->status->hw_ptr;
35 __entry->hw_ptr_base = (substream)->runtime->hw_ptr_base;
50 TP_PROTO(struct snd_pcm_substream *substream),
51 TP_ARGS(substream),
63 __entry->card = (substream)->pcm->card->number;
64 __entry->device = (substream)->pcm->device;
65 __entry->number = (substream)->number;
66 __entry->stream = (substream)->stream;
67 __entry->period_size = (substream)->runtime->period_size;
68 __entry->buffer_size = (substream)->runtime->buffer_size;
69 __entry->old_hw_ptr = (substream)->runtime->status->hw_ptr;
70 __entry->hw_ptr_base = (substream)->runtime->hw_ptr_base;
83 TP_PROTO(struct snd_pcm_substream *substream, const char *why),
84 TP_ARGS(substream, why),
93 __entry->card = (substream)->pcm->card->number;
94 __entry->device = (substream)->pcm->device;
95 __entry->number = (substream)->number;
96 __entry->stream = (substream)->stream;
H A Dpcm_dmaengine.c39 const struct snd_pcm_substream *substream) substream_to_prtd()
41 return substream->runtime->private_data; substream_to_prtd()
44 struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream) snd_dmaengine_pcm_get_chan() argument
46 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_get_chan()
54 * @substream: PCM substream
58 * This function can be used to initialize a dma_slave_config from a substream
61 int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, snd_hwparams_to_dma_slave_config() argument
82 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_hwparams_to_dma_slave_config()
99 * @substream: PCM substream
106 * direction of the substream. If the substream is a playback stream the dst
113 const struct snd_pcm_substream *substream, snd_dmaengine_pcm_set_config_from_dai_data()
117 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_dmaengine_pcm_set_config_from_dai_data()
135 struct snd_pcm_substream *substream = arg; dmaengine_pcm_dma_complete() local
136 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); dmaengine_pcm_dma_complete()
138 prtd->pos += snd_pcm_lib_period_bytes(substream); dmaengine_pcm_dma_complete()
139 if (prtd->pos >= snd_pcm_lib_buffer_bytes(substream)) dmaengine_pcm_dma_complete()
142 snd_pcm_period_elapsed(substream); dmaengine_pcm_dma_complete()
145 static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) dmaengine_pcm_prepare_and_submit() argument
147 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); dmaengine_pcm_prepare_and_submit()
153 direction = snd_pcm_substream_to_dma_direction(substream); dmaengine_pcm_prepare_and_submit()
155 if (!substream->runtime->no_period_wakeup) dmaengine_pcm_prepare_and_submit()
160 substream->runtime->dma_addr, dmaengine_pcm_prepare_and_submit()
161 snd_pcm_lib_buffer_bytes(substream), dmaengine_pcm_prepare_and_submit()
162 snd_pcm_lib_period_bytes(substream), direction, flags); dmaengine_pcm_prepare_and_submit()
168 desc->callback_param = substream; dmaengine_pcm_prepare_and_submit()
176 * @substream: PCM substream
184 int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_dmaengine_pcm_trigger() argument
186 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_trigger()
187 struct snd_pcm_runtime *runtime = substream->runtime; snd_dmaengine_pcm_trigger()
192 ret = dmaengine_pcm_prepare_and_submit(substream); snd_dmaengine_pcm_trigger()
223 * @substream: PCM substream
228 snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream) snd_dmaengine_pcm_pointer_no_residue() argument
230 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_pointer_no_residue()
231 return bytes_to_frames(substream->runtime, prtd->pos); snd_dmaengine_pcm_pointer_no_residue()
237 * @substream: PCM substream
242 snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream) snd_dmaengine_pcm_pointer() argument
244 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_pointer()
252 buf_size = snd_pcm_lib_buffer_bytes(substream); snd_dmaengine_pcm_pointer()
257 return bytes_to_frames(substream->runtime, pos); snd_dmaengine_pcm_pointer()
284 * snd_dmaengine_pcm_open - Open a dmaengine based PCM substream
285 * @substream: PCM substream
291 * this function will use private_data field of the substream's runtime. So it
294 int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, snd_dmaengine_pcm_open() argument
303 ret = snd_pcm_hw_constraint_integer(substream->runtime, snd_dmaengine_pcm_open()
314 substream->runtime->private_data = prtd; snd_dmaengine_pcm_open()
321 * snd_dmaengine_pcm_open_request_chan - Open a dmaengine based PCM substream and request channel
322 * @substream: PCM substream
330 * that this function will use private_data field of the substream's runtime. So
333 int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, snd_dmaengine_pcm_open_request_chan() argument
336 return snd_dmaengine_pcm_open(substream, snd_dmaengine_pcm_open_request_chan()
342 * snd_dmaengine_pcm_close - Close a dmaengine based PCM substream
343 * @substream: PCM substream
345 int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream) snd_dmaengine_pcm_close() argument
347 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_close()
356 * snd_dmaengine_pcm_release_chan_close - Close a dmaengine based PCM substream and release channel
357 * @substream: PCM substream
359 * Releases the DMA channel associated with the PCM substream.
361 int snd_dmaengine_pcm_close_release_chan(struct snd_pcm_substream *substream) snd_dmaengine_pcm_close_release_chan() argument
363 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); snd_dmaengine_pcm_close_release_chan()
367 return snd_dmaengine_pcm_close(substream); snd_dmaengine_pcm_close_release_chan()
38 substream_to_prtd( const struct snd_pcm_substream *substream) substream_to_prtd() argument
112 snd_dmaengine_pcm_set_config_from_dai_data( const struct snd_pcm_substream *substream, const struct snd_dmaengine_dai_dma_data *dma_data, struct dma_slave_config *slave_config) snd_dmaengine_pcm_set_config_from_dai_data() argument
H A Dpcm.c117 struct snd_pcm_substream *substream; snd_pcm_control_ioctl() local
144 for (substream = pstr->substream; substream; snd_pcm_control_ioctl()
145 substream = substream->next) snd_pcm_control_ioctl()
146 if (substream->number == (int)subdevice) snd_pcm_control_ioctl()
148 if (substream == NULL) { snd_pcm_control_ioctl()
152 err = snd_pcm_info_user(substream, info); snd_pcm_control_ioctl()
336 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, snd_pcm_proc_info_read() argument
342 if (! substream) snd_pcm_proc_info_read()
349 err = snd_pcm_info(substream, info); snd_pcm_proc_info_read()
372 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, snd_pcm_stream_proc_info_read()
385 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_substream_proc_hw_params_read() local
388 mutex_lock(&substream->pcm->open_mutex); snd_pcm_substream_proc_hw_params_read()
389 runtime = substream->runtime; snd_pcm_substream_proc_hw_params_read()
406 if (substream->oss.oss) { snd_pcm_substream_proc_hw_params_read()
416 mutex_unlock(&substream->pcm->open_mutex); snd_pcm_substream_proc_hw_params_read()
422 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_substream_proc_sw_params_read() local
425 mutex_lock(&substream->pcm->open_mutex); snd_pcm_substream_proc_sw_params_read()
426 runtime = substream->runtime; snd_pcm_substream_proc_sw_params_read()
444 mutex_unlock(&substream->pcm->open_mutex); snd_pcm_substream_proc_sw_params_read()
450 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_substream_proc_status_read() local
455 mutex_lock(&substream->pcm->open_mutex); snd_pcm_substream_proc_status_read()
456 runtime = substream->runtime; snd_pcm_substream_proc_status_read()
462 err = snd_pcm_status(substream, &status); snd_pcm_substream_proc_status_read()
468 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); snd_pcm_substream_proc_status_read()
480 mutex_unlock(&substream->pcm->open_mutex); snd_pcm_substream_proc_status_read()
487 struct snd_pcm_substream *substream = entry->private_data; snd_pcm_xrun_injection_write() local
490 snd_pcm_stream_lock_irq(substream); snd_pcm_xrun_injection_write()
491 runtime = substream->runtime; snd_pcm_xrun_injection_write()
493 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); snd_pcm_xrun_injection_write()
494 snd_pcm_stream_unlock_irq(substream); snd_pcm_xrun_injection_write()
570 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) snd_pcm_substream_proc_init() argument
576 card = substream->pcm->card; snd_pcm_substream_proc_init()
578 sprintf(name, "sub%i", substream->number); snd_pcm_substream_proc_init()
579 if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) snd_pcm_substream_proc_init()
586 substream->proc_root = entry; snd_pcm_substream_proc_init()
588 if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { snd_pcm_substream_proc_init()
589 snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_init()
596 substream->proc_info_entry = entry; snd_pcm_substream_proc_init()
598 if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { snd_pcm_substream_proc_init()
599 snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_init()
606 substream->proc_hw_params_entry = entry; snd_pcm_substream_proc_init()
608 if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { snd_pcm_substream_proc_init()
609 snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_init()
616 substream->proc_sw_params_entry = entry; snd_pcm_substream_proc_init()
618 if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { snd_pcm_substream_proc_init()
619 snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_init()
626 substream->proc_status_entry = entry; snd_pcm_substream_proc_init()
630 substream->proc_root); snd_pcm_substream_proc_init()
632 entry->private_data = substream; snd_pcm_substream_proc_init()
641 substream->proc_xrun_injection_entry = entry; snd_pcm_substream_proc_init()
647 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) snd_pcm_substream_proc_done() argument
649 snd_info_free_entry(substream->proc_info_entry); snd_pcm_substream_proc_done()
650 substream->proc_info_entry = NULL; snd_pcm_substream_proc_done()
651 snd_info_free_entry(substream->proc_hw_params_entry); snd_pcm_substream_proc_done()
652 substream->proc_hw_params_entry = NULL; snd_pcm_substream_proc_done()
653 snd_info_free_entry(substream->proc_sw_params_entry); snd_pcm_substream_proc_done()
654 substream->proc_sw_params_entry = NULL; snd_pcm_substream_proc_done()
655 snd_info_free_entry(substream->proc_status_entry); snd_pcm_substream_proc_done()
656 substream->proc_status_entry = NULL; snd_pcm_substream_proc_done()
658 snd_info_free_entry(substream->proc_xrun_injection_entry); snd_pcm_substream_proc_done()
659 substream->proc_xrun_injection_entry = NULL; snd_pcm_substream_proc_done()
661 snd_info_free_entry(substream->proc_root); snd_pcm_substream_proc_done()
662 substream->proc_root = NULL; snd_pcm_substream_proc_done()
668 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } snd_pcm_substream_proc_done() argument
669 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } snd_pcm_substream_proc_done() argument
691 struct snd_pcm_substream *substream, *prev; snd_pcm_new_stream() local
716 substream = kzalloc(sizeof(*substream), GFP_KERNEL); snd_pcm_new_stream()
717 if (!substream) snd_pcm_new_stream()
719 substream->pcm = pcm; snd_pcm_new_stream()
720 substream->pstr = pstr; snd_pcm_new_stream()
721 substream->number = idx; snd_pcm_new_stream()
722 substream->stream = stream; snd_pcm_new_stream()
723 sprintf(substream->name, "subdevice #%i", idx); snd_pcm_new_stream()
724 substream->buffer_bytes_max = UINT_MAX; snd_pcm_new_stream()
726 pstr->substream = substream; snd_pcm_new_stream()
728 prev->next = substream; snd_pcm_new_stream()
731 err = snd_pcm_substream_proc_init(substream); snd_pcm_new_stream()
736 pstr->substream = NULL; snd_pcm_new_stream()
739 kfree(substream); snd_pcm_new_stream()
743 substream->group = &substream->self_group; snd_pcm_new_stream()
744 spin_lock_init(&substream->self_group.lock); snd_pcm_new_stream()
745 mutex_init(&substream->self_group.mutex); snd_pcm_new_stream()
746 INIT_LIST_HEAD(&substream->self_group.substreams); snd_pcm_new_stream()
747 list_add_tail(&substream->link_list, &substream->self_group.substreams); snd_pcm_new_stream()
748 atomic_set(&substream->mmap_count, 0); snd_pcm_new_stream()
749 prev = substream; snd_pcm_new_stream()
835 * by userspace. It provides existing ASoC components drivers with a substream
854 struct snd_pcm_substream *substream, *substream_next; snd_pcm_free_stream() local
858 substream = pstr->substream; snd_pcm_free_stream()
859 while (substream) { snd_pcm_free_stream()
860 substream_next = substream->next; snd_pcm_free_stream()
861 snd_pcm_timer_done(substream); snd_pcm_free_stream()
862 snd_pcm_substream_proc_done(substream); snd_pcm_free_stream()
863 kfree(substream); snd_pcm_free_stream()
864 substream = substream_next; snd_pcm_free_stream()
908 struct snd_pcm_substream *substream; snd_pcm_attach_substream() local
921 if (pstr->substream == NULL || pstr->substream_count == 0) snd_pcm_attach_substream()
930 for (substream = pcm->streams[opposite].substream; substream; snd_pcm_attach_substream()
931 substream = substream->next) { snd_pcm_attach_substream()
932 if (SUBSTREAM_BUSY(substream)) snd_pcm_attach_substream()
941 substream = pstr->substream; snd_pcm_attach_substream()
943 for (substream = pstr->substream; substream; snd_pcm_attach_substream()
944 substream = substream->next) snd_pcm_attach_substream()
945 if (substream->number == prefer_subdevice) snd_pcm_attach_substream()
948 if (! substream) snd_pcm_attach_substream()
950 if (! SUBSTREAM_BUSY(substream)) snd_pcm_attach_substream()
952 substream->ref_count++; snd_pcm_attach_substream()
953 *rsubstream = substream; snd_pcm_attach_substream()
957 for (substream = pstr->substream; substream; substream = substream->next) { snd_pcm_attach_substream()
958 if (!SUBSTREAM_BUSY(substream) && snd_pcm_attach_substream()
960 substream->number == prefer_subdevice)) snd_pcm_attach_substream()
963 if (substream == NULL) snd_pcm_attach_substream()
993 substream->runtime = runtime; snd_pcm_attach_substream()
994 substream->private_data = pcm->private_data; snd_pcm_attach_substream()
995 substream->ref_count = 1; snd_pcm_attach_substream()
996 substream->f_flags = file->f_flags; snd_pcm_attach_substream()
997 substream->pid = get_pid(task_pid(current)); snd_pcm_attach_substream()
999 *rsubstream = substream; snd_pcm_attach_substream()
1003 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) snd_pcm_detach_substream() argument
1007 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_detach_substream()
1009 runtime = substream->runtime; snd_pcm_detach_substream()
1021 substream->runtime = NULL; snd_pcm_detach_substream()
1022 put_pid(substream->pid); snd_pcm_detach_substream()
1023 substream->pid = NULL; snd_pcm_detach_substream()
1024 substream->pstr->substream_opened--; snd_pcm_detach_substream()
1065 struct snd_pcm_substream *substream; snd_pcm_dev_register() local
1081 if (pcm->streams[cidx].substream == NULL) snd_pcm_dev_register()
1100 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) snd_pcm_dev_register()
1101 snd_pcm_timer_init(substream); snd_pcm_dev_register()
1116 struct snd_pcm_substream *substream; snd_pcm_dev_disconnect() local
1124 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { snd_pcm_dev_disconnect()
1125 snd_pcm_stream_lock_irq(substream); snd_pcm_dev_disconnect()
1126 if (substream->runtime) { snd_pcm_dev_disconnect()
1127 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; snd_pcm_dev_disconnect()
1128 wake_up(&substream->runtime->sleep); snd_pcm_dev_disconnect()
1129 wake_up(&substream->runtime->tsleep); snd_pcm_dev_disconnect()
1131 snd_pcm_stream_unlock_irq(substream); snd_pcm_dev_disconnect()
1198 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) snd_pcm_proc_read()
1201 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) snd_pcm_proc_read()
H A Drawmidi.c88 static inline int snd_rawmidi_ready(struct snd_rawmidi_substream *substream) snd_rawmidi_ready() argument
90 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_ready()
94 static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substream, snd_rawmidi_ready_append() argument
97 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_ready_append()
99 (!substream->append || runtime->avail >= count); snd_rawmidi_ready_append()
107 runtime->event(runtime->substream); snd_rawmidi_input_event_work()
110 static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) snd_rawmidi_runtime_create() argument
116 runtime->substream = substream; snd_rawmidi_runtime_create()
123 if (substream->stream == SNDRV_RAWMIDI_STREAM_INPUT) snd_rawmidi_runtime_create()
132 substream->runtime = runtime; snd_rawmidi_runtime_create()
136 static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream) snd_rawmidi_runtime_free() argument
138 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_runtime_free()
142 substream->runtime = NULL; snd_rawmidi_runtime_free()
146 static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) snd_rawmidi_output_trigger() argument
148 if (!substream->opened) snd_rawmidi_output_trigger()
150 substream->ops->trigger(substream, up); snd_rawmidi_output_trigger()
153 static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_rawmidi_input_trigger() argument
155 if (!substream->opened) snd_rawmidi_input_trigger()
157 substream->ops->trigger(substream, up); snd_rawmidi_input_trigger()
159 cancel_work_sync(&substream->runtime->event_work); snd_rawmidi_input_trigger()
162 int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream) snd_rawmidi_drop_output() argument
165 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drop_output()
167 snd_rawmidi_output_trigger(substream, 0); snd_rawmidi_drop_output()
177 int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream) snd_rawmidi_drain_output() argument
181 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drain_output()
191 rmidi_warn(substream->rmidi, snd_rawmidi_drain_output()
199 if (substream->ops->drain) snd_rawmidi_drain_output()
200 substream->ops->drain(substream); snd_rawmidi_drain_output()
203 snd_rawmidi_drop_output(substream); snd_rawmidi_drain_output()
209 int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream) snd_rawmidi_drain_input() argument
212 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drain_input()
214 snd_rawmidi_input_trigger(substream, 0); snd_rawmidi_drain_input()
224 /* look for an available substream for the given stream direction;
231 struct snd_rawmidi_substream *substream; assign_substream() local
243 list_for_each_entry(substream, &s->substreams, list) { assign_substream()
244 if (substream->opened) { assign_substream()
247 !substream->append) assign_substream()
250 if (subdevice < 0 || subdevice == substream->number) { assign_substream()
251 *sub_ret = substream; assign_substream()
258 /* open and do ref-counting for the given substream */ open_substream()
260 struct snd_rawmidi_substream *substream, open_substream()
265 if (substream->use_count == 0) { open_substream()
266 err = snd_rawmidi_runtime_create(substream); open_substream()
269 err = substream->ops->open(substream); open_substream()
271 snd_rawmidi_runtime_free(substream); open_substream()
274 substream->opened = 1; open_substream()
275 substream->active_sensing = 0; open_substream()
277 substream->append = 1; open_substream()
278 substream->pid = get_pid(task_pid(current)); open_substream()
279 rmidi->streams[substream->stream].substream_opened++; open_substream()
281 substream->use_count++; open_substream()
286 struct snd_rawmidi_substream *substream,
465 struct snd_rawmidi_substream *substream, close_substream()
468 if (--substream->use_count) close_substream()
472 if (substream->stream == SNDRV_RAWMIDI_STREAM_INPUT) close_substream()
473 snd_rawmidi_input_trigger(substream, 0); close_substream()
475 if (substream->active_sensing) { close_substream()
480 snd_rawmidi_kernel_write(substream, &buf, 1); close_substream()
482 if (snd_rawmidi_drain_output(substream) == -ERESTARTSYS) close_substream()
483 snd_rawmidi_output_trigger(substream, 0); close_substream()
486 substream->ops->close(substream); close_substream()
487 if (substream->runtime->private_free) close_substream()
488 substream->runtime->private_free(substream); close_substream()
489 snd_rawmidi_runtime_free(substream); close_substream()
490 substream->opened = 0; close_substream()
491 substream->append = 0; close_substream()
492 put_pid(substream->pid); close_substream()
493 substream->pid = NULL; close_substream()
494 rmidi->streams[substream->stream].substream_opened--; close_substream()
547 static int snd_rawmidi_info(struct snd_rawmidi_substream *substream, snd_rawmidi_info() argument
552 if (substream == NULL) snd_rawmidi_info()
554 rmidi = substream->rmidi; snd_rawmidi_info()
558 info->subdevice = substream->number; snd_rawmidi_info()
559 info->stream = substream->stream; snd_rawmidi_info()
563 strcpy(info->subname, substream->name); snd_rawmidi_info()
564 info->subdevices_count = substream->pstr->substream_count; snd_rawmidi_info()
565 info->subdevices_avail = (substream->pstr->substream_count - snd_rawmidi_info()
566 substream->pstr->substream_opened); snd_rawmidi_info()
570 static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream, snd_rawmidi_info_user() argument
575 if ((err = snd_rawmidi_info(substream, &info)) < 0) snd_rawmidi_info_user()
586 struct snd_rawmidi_substream *substream; snd_rawmidi_info_select() local
600 list_for_each_entry(substream, &pstr->substreams, list) { snd_rawmidi_info_select()
601 if ((unsigned int)substream->number == info->subdevice) snd_rawmidi_info_select()
602 return snd_rawmidi_info(substream, info); snd_rawmidi_info_select()
626 int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, snd_rawmidi_output_params() argument
630 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_output_params()
632 if (substream->append && substream->use_count > 1) snd_rawmidi_output_params()
634 snd_rawmidi_drain_output(substream); snd_rawmidi_output_params()
651 substream->active_sensing = !params->no_active_sensing; snd_rawmidi_output_params()
656 int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, snd_rawmidi_input_params() argument
660 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_input_params()
662 snd_rawmidi_drain_input(substream); snd_rawmidi_input_params()
682 static int snd_rawmidi_output_status(struct snd_rawmidi_substream *substream, snd_rawmidi_output_status() argument
685 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_output_status()
695 static int snd_rawmidi_input_status(struct snd_rawmidi_substream *substream, snd_rawmidi_input_status() argument
698 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_input_status()
866 * @substream: the rawmidi substream
874 int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, snd_rawmidi_receive() argument
879 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_receive()
881 if (!substream->opened) snd_rawmidi_receive()
884 rmidi_dbg(substream->rmidi, snd_rawmidi_receive()
890 substream->bytes++; snd_rawmidi_receive()
900 substream->bytes += count; snd_rawmidi_receive()
930 else if (snd_rawmidi_ready(substream)) snd_rawmidi_receive()
938 static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream, snd_rawmidi_kernel_read1() argument
944 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_kernel_read1()
978 long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream, snd_rawmidi_kernel_read() argument
981 snd_rawmidi_input_trigger(substream, 1); snd_rawmidi_kernel_read()
982 return snd_rawmidi_kernel_read1(substream, NULL/*userbuf*/, buf, count); snd_rawmidi_kernel_read()
992 struct snd_rawmidi_substream *substream; snd_rawmidi_read() local
996 substream = rfile->input; snd_rawmidi_read()
997 if (substream == NULL) snd_rawmidi_read()
999 runtime = substream->runtime; snd_rawmidi_read()
1000 snd_rawmidi_input_trigger(substream, 1); snd_rawmidi_read()
1004 while (!snd_rawmidi_ready(substream)) { snd_rawmidi_read()
1025 count1 = snd_rawmidi_kernel_read1(substream, snd_rawmidi_read()
1040 * @substream: the rawmidi substream
1044 int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream) snd_rawmidi_transmit_empty() argument
1046 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_empty()
1051 rmidi_dbg(substream->rmidi, snd_rawmidi_transmit_empty()
1064 * @substream: the rawmidi substream
1070 int __snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, __snd_rawmidi_transmit_peek() argument
1074 struct snd_rawmidi_runtime *runtime = substream->runtime; __snd_rawmidi_transmit_peek()
1077 rmidi_dbg(substream->rmidi, __snd_rawmidi_transmit_peek()
1112 * @substream: the rawmidi substream
1124 int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, snd_rawmidi_transmit_peek() argument
1127 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_peek()
1132 result = __snd_rawmidi_transmit_peek(substream, buffer, count); snd_rawmidi_transmit_peek()
1140 * @substream: the rawmidi substream
1145 int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) __snd_rawmidi_transmit_ack() argument
1147 struct snd_rawmidi_runtime *runtime = substream->runtime; __snd_rawmidi_transmit_ack()
1150 rmidi_dbg(substream->rmidi, __snd_rawmidi_transmit_ack()
1158 substream->bytes += count; __snd_rawmidi_transmit_ack()
1160 if (runtime->drain || snd_rawmidi_ready(substream)) __snd_rawmidi_transmit_ack()
1169 * @substream: the rawmidi substream
1178 int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) snd_rawmidi_transmit_ack() argument
1180 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit_ack()
1185 result = __snd_rawmidi_transmit_ack(substream, count); snd_rawmidi_transmit_ack()
1193 * @substream: the rawmidi substream
1201 int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, snd_rawmidi_transmit() argument
1204 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_transmit()
1209 if (!substream->opened) snd_rawmidi_transmit()
1212 count = __snd_rawmidi_transmit_peek(substream, buffer, count); snd_rawmidi_transmit()
1216 result = __snd_rawmidi_transmit_ack(substream, count); snd_rawmidi_transmit()
1223 static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, snd_rawmidi_kernel_write1() argument
1230 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_kernel_write1()
1240 if (substream->append) { snd_rawmidi_kernel_write1()
1279 snd_rawmidi_output_trigger(substream, 1); snd_rawmidi_kernel_write1()
1283 long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream, snd_rawmidi_kernel_write() argument
1286 return snd_rawmidi_kernel_write1(substream, NULL, buf, count); snd_rawmidi_kernel_write()
1297 struct snd_rawmidi_substream *substream; snd_rawmidi_write() local
1300 substream = rfile->output; snd_rawmidi_write()
1301 runtime = substream->runtime; snd_rawmidi_write()
1303 if (substream->append && count > runtime->buffer_size) snd_rawmidi_write()
1308 while (!snd_rawmidi_ready_append(substream, count)) { snd_rawmidi_write()
1329 count1 = snd_rawmidi_kernel_write1(substream, buf, NULL, count); snd_rawmidi_write()
1404 struct snd_rawmidi_substream *substream; snd_rawmidi_proc_info_read() local
1411 list_for_each_entry(substream, snd_rawmidi_proc_info_read()
1417 substream->number, snd_rawmidi_proc_info_read()
1418 (unsigned long) substream->bytes); snd_rawmidi_proc_info_read()
1419 if (substream->opened) { snd_rawmidi_proc_info_read()
1422 pid_vnr(substream->pid)); snd_rawmidi_proc_info_read()
1423 runtime = substream->runtime; snd_rawmidi_proc_info_read()
1435 list_for_each_entry(substream, snd_rawmidi_proc_info_read()
1441 substream->number, snd_rawmidi_proc_info_read()
1442 (unsigned long) substream->bytes); snd_rawmidi_proc_info_read()
1443 if (substream->opened) { snd_rawmidi_proc_info_read()
1446 pid_vnr(substream->pid)); snd_rawmidi_proc_info_read()
1447 runtime = substream->runtime; snd_rawmidi_proc_info_read()
1483 struct snd_rawmidi_substream *substream; snd_rawmidi_alloc_substreams() local
1487 substream = kzalloc(sizeof(*substream), GFP_KERNEL); snd_rawmidi_alloc_substreams()
1488 if (!substream) snd_rawmidi_alloc_substreams()
1490 substream->stream = direction; snd_rawmidi_alloc_substreams()
1491 substream->number = idx; snd_rawmidi_alloc_substreams()
1492 substream->rmidi = rmidi; snd_rawmidi_alloc_substreams()
1493 substream->pstr = stream; snd_rawmidi_alloc_substreams()
1494 list_add_tail(&substream->list, &stream->substreams); snd_rawmidi_alloc_substreams()
1578 struct snd_rawmidi_substream *substream; snd_rawmidi_free_substreams() local
1581 substream = list_entry(stream->substreams.next, struct snd_rawmidi_substream, list); snd_rawmidi_free_substreams()
1582 list_del(&substream->list); snd_rawmidi_free_substreams()
1583 kfree(substream); snd_rawmidi_free_substreams()
1752 struct snd_rawmidi_substream *substream; snd_rawmidi_set_ops() local
1754 list_for_each_entry(substream, &rmidi->streams[stream].substreams, list) snd_rawmidi_set_ops()
1755 substream->ops = ops; snd_rawmidi_set_ops()
259 open_substream(struct snd_rawmidi *rmidi, struct snd_rawmidi_substream *substream, int mode) open_substream() argument
464 close_substream(struct snd_rawmidi *rmidi, struct snd_rawmidi_substream *substream, int cleanup) close_substream() argument
H A Dpcm_compat.c26 static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_delay_compat() argument
34 err = snd_pcm_delay(substream, &delay); snd_pcm_ioctl_delay_compat()
43 static int snd_pcm_ioctl_rewind_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_rewind_compat() argument
51 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_ioctl_rewind_compat()
52 err = snd_pcm_playback_rewind(substream, frames); snd_pcm_ioctl_rewind_compat()
54 err = snd_pcm_capture_rewind(substream, frames); snd_pcm_ioctl_rewind_compat()
60 static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_forward_compat() argument
68 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_ioctl_forward_compat()
69 err = snd_pcm_playback_forward(substream, frames); snd_pcm_ioctl_forward_compat()
71 err = snd_pcm_capture_forward(substream, frames); snd_pcm_ioctl_forward_compat()
122 static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_sw_params_compat() argument
146 boundary = recalculate_boundary(substream->runtime); snd_pcm_ioctl_sw_params_compat()
148 params.silence_size = substream->runtime->boundary; snd_pcm_ioctl_sw_params_compat()
149 err = snd_pcm_sw_params(substream, &params); snd_pcm_ioctl_sw_params_compat()
164 static int snd_pcm_ioctl_channel_info_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_channel_info_compat() argument
175 err = snd_pcm_channel_info(substream, &info); snd_pcm_ioctl_channel_info_compat()
188 static int snd_pcm_channel_info_user(struct snd_pcm_substream *substream,
213 static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream, snd_pcm_status_user_compat() argument
229 err = snd_pcm_status(substream, &status); snd_pcm_status_user_compat()
277 static int snd_pcm_status_user_x32(struct snd_pcm_substream *substream, snd_pcm_status_user_x32() argument
293 err = snd_pcm_status(substream, &status); snd_pcm_status_user_x32()
320 static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_hw_params_compat() argument
328 if (! (runtime = substream->runtime)) snd_pcm_ioctl_hw_params_compat()
342 err = snd_pcm_hw_refine(substream, data); snd_pcm_ioctl_hw_params_compat()
344 err = snd_pcm_hw_params(substream, data); snd_pcm_ioctl_hw_params_compat()
372 static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_xferi_compat() argument
379 if (! substream->runtime) snd_pcm_ioctl_xferi_compat()
381 if (substream->stream != dir) snd_pcm_ioctl_xferi_compat()
383 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) snd_pcm_ioctl_xferi_compat()
391 err = snd_pcm_lib_write(substream, compat_ptr(buf), frames); snd_pcm_ioctl_xferi_compat()
393 err = snd_pcm_lib_read(substream, compat_ptr(buf), frames); snd_pcm_ioctl_xferi_compat()
416 static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_xfern_compat() argument
425 if (! substream->runtime) snd_pcm_ioctl_xfern_compat()
427 if (substream->stream != dir) snd_pcm_ioctl_xfern_compat()
430 if ((ch = substream->runtime->channels) > 128) snd_pcm_ioctl_xfern_compat()
449 err = snd_pcm_lib_writev(substream, bufs, frames); snd_pcm_ioctl_xfern_compat()
451 err = snd_pcm_lib_readv(substream, bufs, frames); snd_pcm_ioctl_xfern_compat()
487 static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream, snd_pcm_ioctl_sync_ptr_compat() argument
490 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_ioctl_sync_ptr_compat()
507 err = snd_pcm_hwsync(substream); snd_pcm_ioctl_sync_ptr_compat()
516 snd_pcm_stream_lock_irq(substream); snd_pcm_ioctl_sync_ptr_compat()
531 snd_pcm_stream_unlock_irq(substream); snd_pcm_ioctl_sync_ptr_compat()
575 static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream *substream, snd_pcm_ioctl_sync_ptr_x32() argument
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_ioctl_sync_ptr_x32()
595 err = snd_pcm_hwsync(substream); snd_pcm_ioctl_sync_ptr_x32()
604 snd_pcm_stream_lock_irq(substream); snd_pcm_ioctl_sync_ptr_x32()
619 snd_pcm_stream_unlock_irq(substream); snd_pcm_ioctl_sync_ptr_x32()
661 struct snd_pcm_substream *substream; snd_pcm_ioctl_compat() local
667 substream = pcm_file->substream; snd_pcm_ioctl_compat()
668 if (! substream) snd_pcm_ioctl_compat()
695 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_ioctl_compat()
696 return snd_pcm_playback_ioctl1(file, substream, cmd, argp); snd_pcm_ioctl_compat()
698 return snd_pcm_capture_ioctl1(file, substream, cmd, argp); snd_pcm_ioctl_compat()
700 return snd_pcm_ioctl_hw_params_compat(substream, 1, argp); snd_pcm_ioctl_compat()
702 return snd_pcm_ioctl_hw_params_compat(substream, 0, argp); snd_pcm_ioctl_compat()
704 return snd_pcm_ioctl_sw_params_compat(substream, argp); snd_pcm_ioctl_compat()
706 return snd_pcm_status_user_compat(substream, argp, false); snd_pcm_ioctl_compat()
708 return snd_pcm_status_user_compat(substream, argp, true); snd_pcm_ioctl_compat()
710 return snd_pcm_ioctl_sync_ptr_compat(substream, argp); snd_pcm_ioctl_compat()
712 return snd_pcm_ioctl_channel_info_compat(substream, argp); snd_pcm_ioctl_compat()
714 return snd_pcm_ioctl_xferi_compat(substream, SNDRV_PCM_STREAM_PLAYBACK, argp); snd_pcm_ioctl_compat()
716 return snd_pcm_ioctl_xferi_compat(substream, SNDRV_PCM_STREAM_CAPTURE, argp); snd_pcm_ioctl_compat()
718 return snd_pcm_ioctl_xfern_compat(substream, SNDRV_PCM_STREAM_PLAYBACK, argp); snd_pcm_ioctl_compat()
720 return snd_pcm_ioctl_xfern_compat(substream, SNDRV_PCM_STREAM_CAPTURE, argp); snd_pcm_ioctl_compat()
722 return snd_pcm_ioctl_delay_compat(substream, argp); snd_pcm_ioctl_compat()
724 return snd_pcm_ioctl_rewind_compat(substream, argp); snd_pcm_ioctl_compat()
726 return snd_pcm_ioctl_forward_compat(substream, argp); snd_pcm_ioctl_compat()
729 return snd_pcm_status_user_x32(substream, argp, false); snd_pcm_ioctl_compat()
731 return snd_pcm_status_user_x32(substream, argp, true); snd_pcm_ioctl_compat()
733 return snd_pcm_ioctl_sync_ptr_x32(substream, argp); snd_pcm_ioctl_compat()
735 return snd_pcm_ioctl_channel_info_x32(substream, argp); snd_pcm_ioctl_compat()
H A Dpcm_lib.c39 #define trace_hwptr(substream, pos, in_interrupt)
40 #define trace_xrun(substream)
41 #define trace_hw_ptr_error(substream, reason)
53 void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr) snd_pcm_playback_silence() argument
55 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_silence()
111 if (substream->ops->silence) { snd_pcm_playback_silence()
113 err = substream->ops->silence(substream, -1, ofs, transfer); snd_pcm_playback_silence()
122 if (substream->ops->silence) { snd_pcm_playback_silence()
125 err = substream->ops->silence(substream, c, ofs, transfer); snd_pcm_playback_silence()
143 void snd_pcm_debug_name(struct snd_pcm_substream *substream, snd_pcm_debug_name() argument
147 substream->pcm->card->number, snd_pcm_debug_name()
148 substream->pcm->device, snd_pcm_debug_name()
149 substream->stream ? 'c' : 'p', snd_pcm_debug_name()
150 substream->number); snd_pcm_debug_name()
161 #define xrun_debug(substream, mask) \
162 ((substream)->pstr->xrun_debug & (mask))
164 #define xrun_debug(substream, mask) 0
167 #define dump_stack_on_xrun(substream) do { \
168 if (xrun_debug(substream, XRUN_DEBUG_STACK)) \
172 static void xrun(struct snd_pcm_substream *substream) xrun() argument
174 struct snd_pcm_runtime *runtime = substream->runtime; xrun()
176 trace_xrun(substream); xrun()
179 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); xrun()
180 if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { xrun()
182 snd_pcm_debug_name(substream, name, sizeof(name)); xrun()
183 pcm_warn(substream->pcm, "XRUN: %s\n", name); xrun()
184 dump_stack_on_xrun(substream); xrun()
189 #define hw_ptr_error(substream, in_interrupt, reason, fmt, args...) \
191 trace_hw_ptr_error(substream, reason); \
192 if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { \
195 dump_stack_on_xrun(substream); \
201 #define hw_ptr_error(substream, fmt, args...) do { } while (0)
205 int snd_pcm_update_state(struct snd_pcm_substream *substream, snd_pcm_update_state() argument
210 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_update_state()
218 snd_pcm_drain_done(substream); snd_pcm_update_state()
223 xrun(substream); snd_pcm_update_state()
235 static void update_audio_tstamp(struct snd_pcm_substream *substream, update_audio_tstamp() argument
239 struct snd_pcm_runtime *runtime = substream->runtime; update_audio_tstamp()
246 if (!(substream->ops->get_time_info) || update_audio_tstamp()
258 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) update_audio_tstamp()
274 snd_pcm_gettime(substream->runtime, (struct timespec *)&driver_tstamp); update_audio_tstamp()
278 static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, snd_pcm_update_hw_ptr0() argument
281 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_update_hw_ptr0()
299 pos = substream->ops->pointer(substream); snd_pcm_update_hw_ptr0()
302 if ((substream->ops->get_time_info) && snd_pcm_update_hw_ptr0()
304 substream->ops->get_time_info(substream, &curr_tstamp, snd_pcm_update_hw_ptr0()
317 xrun(substream); snd_pcm_update_hw_ptr0()
323 snd_pcm_debug_name(substream, name, sizeof(name)); snd_pcm_update_hw_ptr0()
324 pcm_err(substream->pcm, snd_pcm_update_hw_ptr0()
332 trace_hwptr(substream, pos, in_interrupt); snd_pcm_update_hw_ptr0()
394 hw_ptr_error(substream, in_interrupt, "Unexpected hw_ptr", snd_pcm_update_hw_ptr0()
396 substream->stream, (long)pos, snd_pcm_update_hw_ptr0()
402 if (!xrun_debug(substream, XRUN_DEBUG_JIFFIESCHECK)) snd_pcm_update_hw_ptr0()
434 hw_ptr_error(substream, in_interrupt, "hw_ptr skipping", snd_pcm_update_hw_ptr0()
447 hw_ptr_error(substream, in_interrupt, snd_pcm_update_hw_ptr0()
450 substream->stream, (long)delta, snd_pcm_update_hw_ptr0()
457 update_audio_tstamp(substream, &curr_tstamp, &audio_tstamp); snd_pcm_update_hw_ptr0()
461 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_pcm_update_hw_ptr0()
463 snd_pcm_playback_silence(substream, new_hw_ptr); snd_pcm_update_hw_ptr0()
482 update_audio_tstamp(substream, &curr_tstamp, &audio_tstamp); snd_pcm_update_hw_ptr0()
484 return snd_pcm_update_state(substream, runtime); snd_pcm_update_hw_ptr0()
488 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) snd_pcm_update_hw_ptr() argument
490 return snd_pcm_update_hw_ptr0(substream, 0); snd_pcm_update_hw_ptr()
505 struct snd_pcm_substream *substream; snd_pcm_set_ops() local
507 for (substream = stream->substream; substream != NULL; substream = substream->next) snd_pcm_set_ops()
508 substream->ops = ops; snd_pcm_set_ops()
515 * @substream: the pcm substream
519 void snd_pcm_set_sync(struct snd_pcm_substream *substream) snd_pcm_set_sync() argument
521 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_set_sync()
523 runtime->sync.id32[0] = substream->pcm->card->number; snd_pcm_set_sync()
1758 static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream, snd_pcm_lib_ioctl_reset() argument
1761 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_ioctl_reset()
1763 snd_pcm_stream_lock_irqsave(substream, flags); snd_pcm_lib_ioctl_reset()
1764 if (snd_pcm_running(substream) && snd_pcm_lib_ioctl_reset()
1765 snd_pcm_update_hw_ptr(substream) >= 0) snd_pcm_lib_ioctl_reset()
1771 snd_pcm_stream_unlock_irqrestore(substream, flags); snd_pcm_lib_ioctl_reset()
1775 static int snd_pcm_lib_ioctl_channel_info(struct snd_pcm_substream *substream, snd_pcm_lib_ioctl_channel_info() argument
1779 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_ioctl_channel_info()
1810 static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, snd_pcm_lib_ioctl_fifo_size() argument
1818 params->fifo_size = substream->runtime->hw.fifo_size; snd_pcm_lib_ioctl_fifo_size()
1819 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { snd_pcm_lib_ioctl_fifo_size()
1831 * @substream: the pcm substream instance
1840 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, snd_pcm_lib_ioctl() argument
1847 return snd_pcm_lib_ioctl_reset(substream, arg); snd_pcm_lib_ioctl()
1849 return snd_pcm_lib_ioctl_channel_info(substream, arg); snd_pcm_lib_ioctl()
1851 return snd_pcm_lib_ioctl_fifo_size(substream, arg); snd_pcm_lib_ioctl()
1860 * @substream: the pcm substream instance
1869 void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) snd_pcm_period_elapsed() argument
1874 if (PCM_RUNTIME_CHECK(substream)) snd_pcm_period_elapsed()
1876 runtime = substream->runtime; snd_pcm_period_elapsed()
1879 runtime->transfer_ack_begin(substream); snd_pcm_period_elapsed()
1881 snd_pcm_stream_lock_irqsave(substream, flags); snd_pcm_period_elapsed()
1882 if (!snd_pcm_running(substream) || snd_pcm_period_elapsed()
1883 snd_pcm_update_hw_ptr0(substream, 1) < 0) snd_pcm_period_elapsed()
1886 if (substream->timer_running) snd_pcm_period_elapsed()
1887 snd_timer_interrupt(substream->timer, 1); snd_pcm_period_elapsed()
1889 snd_pcm_stream_unlock_irqrestore(substream, flags); snd_pcm_period_elapsed()
1891 runtime->transfer_ack_end(substream); snd_pcm_period_elapsed()
1903 static int wait_for_avail(struct snd_pcm_substream *substream, wait_for_avail() argument
1906 struct snd_pcm_runtime *runtime = substream->runtime; wait_for_avail()
1907 int is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; wait_for_avail()
1947 snd_pcm_stream_unlock_irq(substream); wait_for_avail()
1951 snd_pcm_stream_lock_irq(substream); wait_for_avail()
1975 pcm_dbg(substream->pcm, wait_for_avail()
1989 static int snd_pcm_lib_write_transfer(struct snd_pcm_substream *substream, snd_pcm_lib_write_transfer() argument
1994 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_write_transfer()
1997 if (substream->ops->copy) { snd_pcm_lib_write_transfer()
1998 if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0) snd_pcm_lib_write_transfer()
2008 typedef int (*transfer_f)(struct snd_pcm_substream *substream, unsigned int hwoff,
2012 static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream, snd_pcm_lib_write1() argument
2018 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_write1()
2027 snd_pcm_stream_lock_irq(substream); snd_pcm_lib_write1()
2046 snd_pcm_update_hw_ptr(substream); snd_pcm_lib_write1()
2058 err = wait_for_avail(substream, &avail); snd_pcm_lib_write1()
2068 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_write1()
2073 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_write1()
2074 err = transfer(substream, appl_ofs, data, offset, frames); snd_pcm_lib_write1()
2075 snd_pcm_stream_lock_irq(substream); snd_pcm_lib_write1()
2092 if (substream->ops->ack) snd_pcm_lib_write1()
2093 substream->ops->ack(substream); snd_pcm_lib_write1()
2101 err = snd_pcm_start(substream); snd_pcm_lib_write1()
2109 snd_pcm_update_state(substream, runtime); snd_pcm_lib_write1()
2110 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_write1()
2115 static int pcm_sanity_check(struct snd_pcm_substream *substream) pcm_sanity_check() argument
2118 if (PCM_RUNTIME_CHECK(substream)) pcm_sanity_check()
2120 runtime = substream->runtime; pcm_sanity_check()
2121 if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area)) pcm_sanity_check()
2128 snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, const void __user *buf, snd_pcm_uframes_t size) snd_pcm_lib_write() argument
2134 err = pcm_sanity_check(substream); snd_pcm_lib_write()
2137 runtime = substream->runtime; snd_pcm_lib_write()
2138 nonblock = !!(substream->f_flags & O_NONBLOCK); snd_pcm_lib_write()
2143 return snd_pcm_lib_write1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_write()
2149 static int snd_pcm_lib_writev_transfer(struct snd_pcm_substream *substream, snd_pcm_lib_writev_transfer() argument
2154 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_writev_transfer()
2159 if (substream->ops->copy) { snd_pcm_lib_writev_transfer()
2160 if (snd_BUG_ON(!substream->ops->silence)) snd_pcm_lib_writev_transfer()
2164 if ((err = substream->ops->silence(substream, c, hwoff, frames)) < 0) snd_pcm_lib_writev_transfer()
2168 if ((err = substream->ops->copy(substream, c, hwoff, buf, frames)) < 0) snd_pcm_lib_writev_transfer()
2189 snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, snd_pcm_lib_writev() argument
2197 err = pcm_sanity_check(substream); snd_pcm_lib_writev()
2200 runtime = substream->runtime; snd_pcm_lib_writev()
2201 nonblock = !!(substream->f_flags & O_NONBLOCK); snd_pcm_lib_writev()
2205 return snd_pcm_lib_write1(substream, (unsigned long)bufs, frames, snd_pcm_lib_writev()
2211 static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, snd_pcm_lib_read_transfer() argument
2216 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_read_transfer()
2219 if (substream->ops->copy) { snd_pcm_lib_read_transfer()
2220 if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0) snd_pcm_lib_read_transfer()
2230 static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream, snd_pcm_lib_read1() argument
2236 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_read1()
2245 snd_pcm_stream_lock_irq(substream); snd_pcm_lib_read1()
2249 err = snd_pcm_start(substream); snd_pcm_lib_read1()
2271 snd_pcm_update_hw_ptr(substream); snd_pcm_lib_read1()
2279 snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_lib_read1()
2288 err = wait_for_avail(substream, &avail); snd_pcm_lib_read1()
2300 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_read1()
2305 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_read1()
2306 err = transfer(substream, appl_ofs, data, offset, frames); snd_pcm_lib_read1()
2307 snd_pcm_stream_lock_irq(substream); snd_pcm_lib_read1()
2324 if (substream->ops->ack) snd_pcm_lib_read1()
2325 substream->ops->ack(substream); snd_pcm_lib_read1()
2335 snd_pcm_update_state(substream, runtime); snd_pcm_lib_read1()
2336 snd_pcm_stream_unlock_irq(substream); snd_pcm_lib_read1()
2340 snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, void __user *buf, snd_pcm_uframes_t size) snd_pcm_lib_read() argument
2346 err = pcm_sanity_check(substream); snd_pcm_lib_read()
2349 runtime = substream->runtime; snd_pcm_lib_read()
2350 nonblock = !!(substream->f_flags & O_NONBLOCK); snd_pcm_lib_read()
2353 return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer); snd_pcm_lib_read()
2358 static int snd_pcm_lib_readv_transfer(struct snd_pcm_substream *substream, snd_pcm_lib_readv_transfer() argument
2363 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_readv_transfer()
2368 if (substream->ops->copy) { snd_pcm_lib_readv_transfer()
2374 if ((err = substream->ops->copy(substream, c, hwoff, buf, frames)) < 0) snd_pcm_lib_readv_transfer()
2394 snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, snd_pcm_lib_readv() argument
2402 err = pcm_sanity_check(substream); snd_pcm_lib_readv()
2405 runtime = substream->runtime; snd_pcm_lib_readv()
2409 nonblock = !!(substream->f_flags & O_NONBLOCK); snd_pcm_lib_readv()
2412 return snd_pcm_lib_read1(substream, (unsigned long)bufs, frames, nonblock, snd_pcm_lib_readv_transfer); snd_pcm_lib_readv()
2493 struct snd_pcm_substream *substream; pcm_chmap_ctl_get() local
2498 substream = snd_pcm_chmap_substream(info, idx); pcm_chmap_ctl_get()
2499 if (!substream) pcm_chmap_ctl_get()
2503 if (!substream->runtime) pcm_chmap_ctl_get()
2507 if (map->channels == substream->runtime->channels && pcm_chmap_ctl_get()
/linux-4.1.27/sound/soc/omap/
H A Domap-pcm.c75 static int omap_pcm_hw_params(struct snd_pcm_substream *substream, omap_pcm_hw_params() argument
78 struct snd_pcm_runtime *runtime = substream->runtime; omap_pcm_hw_params()
79 struct snd_soc_pcm_runtime *rtd = substream->private_data; omap_pcm_hw_params()
85 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); omap_pcm_hw_params()
92 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); omap_pcm_hw_params()
95 chan = snd_dmaengine_pcm_get_chan(substream); omap_pcm_hw_params()
100 err = snd_hwparams_to_dma_slave_config(substream, params, &config); omap_pcm_hw_params()
104 snd_dmaengine_pcm_set_config_from_dai_data(substream, omap_pcm_hw_params()
105 snd_soc_dai_get_dma_data(rtd->cpu_dai, substream), omap_pcm_hw_params()
111 static int omap_pcm_hw_free(struct snd_pcm_substream *substream) omap_pcm_hw_free() argument
113 snd_pcm_set_runtime_buffer(substream, NULL); omap_pcm_hw_free()
117 static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream) omap_pcm_pointer() argument
122 offset = snd_dmaengine_pcm_pointer_no_residue(substream); omap_pcm_pointer()
124 offset = snd_dmaengine_pcm_pointer(substream); omap_pcm_pointer()
129 static int omap_pcm_open(struct snd_pcm_substream *substream) omap_pcm_open() argument
131 struct snd_soc_pcm_runtime *rtd = substream->private_data; omap_pcm_open()
135 snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware); omap_pcm_open()
137 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); omap_pcm_open()
145 ret = snd_dmaengine_pcm_open(substream, chan); omap_pcm_open()
147 ret = snd_dmaengine_pcm_open_request_chan(substream, omap_pcm_open()
154 static int omap_pcm_mmap(struct snd_pcm_substream *substream, omap_pcm_mmap() argument
157 struct snd_pcm_runtime *runtime = substream->runtime; omap_pcm_mmap()
159 return dma_mmap_writecombine(substream->pcm->card->dev, vma, omap_pcm_mmap()
179 struct snd_pcm_substream *substream = pcm->streams[stream].substream; omap_pcm_preallocate_dma_buffer() local
180 struct snd_dma_buffer *buf = &substream->dma_buffer; omap_pcm_preallocate_dma_buffer()
197 struct snd_pcm_substream *substream; omap_pcm_free_dma_buffers() local
202 substream = pcm->streams[stream].substream; omap_pcm_free_dma_buffers()
203 if (!substream) omap_pcm_free_dma_buffers()
206 buf = &substream->dma_buffer; omap_pcm_free_dma_buffers()
226 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { omap_pcm_new()
233 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { omap_pcm_new()
H A Domap-hdmi-audio.c72 static int hdmi_dai_startup(struct snd_pcm_substream *substream, hdmi_dai_startup() argument
75 struct hdmi_audio_data *ad = card_drvdata_substream(substream); hdmi_dai_startup()
81 ret = snd_pcm_hw_constraint_step(substream->runtime, 0, hdmi_dai_startup()
88 snd_soc_dai_set_dma_data(dai, substream, &ad->dma_data); hdmi_dai_startup()
91 ad->current_stream = substream; hdmi_dai_startup()
105 static int hdmi_dai_hw_params(struct snd_pcm_substream *substream, hdmi_dai_hw_params() argument
109 struct hdmi_audio_data *ad = card_drvdata_substream(substream); hdmi_dai_hw_params()
113 WARN_ON(ad->current_stream != substream); hdmi_dai_hw_params()
229 static int hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd, hdmi_dai_trigger() argument
232 struct hdmi_audio_data *ad = card_drvdata_substream(substream); hdmi_dai_trigger()
235 WARN_ON(ad->current_stream != substream); hdmi_dai_trigger()
254 static void hdmi_dai_shutdown(struct snd_pcm_substream *substream, hdmi_dai_shutdown() argument
257 struct hdmi_audio_data *ad = card_drvdata_substream(substream); hdmi_dai_shutdown()
259 WARN_ON(ad->current_stream != substream); hdmi_dai_shutdown()
H A Domap-mcbsp.c66 static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream, omap_mcbsp_set_threshold() argument
69 struct snd_soc_pcm_runtime *rtd = substream->private_data; omap_mcbsp_set_threshold()
86 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) omap_mcbsp_set_threshold()
111 static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream, omap_mcbsp_dai_startup() argument
141 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) omap_mcbsp_dai_startup()
142 snd_pcm_hw_rule_add(substream->runtime, 0, omap_mcbsp_dai_startup()
149 snd_pcm_hw_constraint_step(substream->runtime, 0, omap_mcbsp_dai_startup()
156 static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream, omap_mcbsp_dai_shutdown() argument
167 static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd, omap_mcbsp_dai_trigger() argument
171 int err = 0, play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); omap_mcbsp_dai_trigger()
195 struct snd_pcm_substream *substream, omap_mcbsp_dai_delay()
198 struct snd_soc_pcm_runtime *rtd = substream->private_data; omap_mcbsp_dai_delay()
204 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) omap_mcbsp_dai_delay()
214 delay = fifo_use / substream->runtime->channels; omap_mcbsp_dai_delay()
219 static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, omap_mcbsp_dai_hw_params() argument
230 dma_data = snd_soc_dai_get_dma_data(cpu_dai, substream); omap_mcbsp_dai_hw_params()
249 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) omap_mcbsp_dai_hw_params()
274 omap_mcbsp_set_threshold(substream, pkt_size); omap_mcbsp_dai_hw_params()
194 omap_mcbsp_dai_delay( struct snd_pcm_substream *substream, struct snd_soc_dai *dai) omap_mcbsp_dai_delay() argument
H A Dosk5912.c42 static int osk_startup(struct snd_pcm_substream *substream) osk_startup() argument
47 static void osk_shutdown(struct snd_pcm_substream *substream) osk_shutdown() argument
52 static int osk_hw_params(struct snd_pcm_substream *substream, osk_hw_params() argument
55 struct snd_soc_pcm_runtime *rtd = substream->private_data; osk_hw_params()
/linux-4.1.27/sound/arm/
H A Dpxa2xx-pcm.c25 static int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream) pxa2xx_pcm_prepare() argument
27 struct pxa2xx_pcm_client *client = substream->private_data; pxa2xx_pcm_prepare()
29 __pxa2xx_pcm_prepare(substream); pxa2xx_pcm_prepare()
31 return client->prepare(substream); pxa2xx_pcm_prepare()
34 static int pxa2xx_pcm_open(struct snd_pcm_substream *substream) pxa2xx_pcm_open() argument
36 struct pxa2xx_pcm_client *client = substream->private_data; pxa2xx_pcm_open()
37 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_open()
41 ret = __pxa2xx_pcm_open(substream); pxa2xx_pcm_open()
47 rtd->params = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? pxa2xx_pcm_open()
50 pxa2xx_pcm_dma_irq, substream); pxa2xx_pcm_open()
55 ret = client->startup(substream); pxa2xx_pcm_open()
61 __pxa2xx_pcm_close(substream); pxa2xx_pcm_open()
66 static int pxa2xx_pcm_close(struct snd_pcm_substream *substream) pxa2xx_pcm_close() argument
68 struct pxa2xx_pcm_client *client = substream->private_data; pxa2xx_pcm_close()
69 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; pxa2xx_pcm_close()
72 client->shutdown(substream); pxa2xx_pcm_close()
74 return __pxa2xx_pcm_close(substream); pxa2xx_pcm_close()
H A Dpxa2xx-pcm-lib.c39 int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, __pxa2xx_pcm_hw_params() argument
42 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_hw_params()
78 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); __pxa2xx_pcm_hw_params()
87 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { __pxa2xx_pcm_hw_params()
106 int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream) __pxa2xx_pcm_hw_free() argument
108 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; __pxa2xx_pcm_hw_free()
115 snd_pcm_set_runtime_buffer(substream, NULL); __pxa2xx_pcm_hw_free()
120 int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) pxa2xx_pcm_trigger() argument
122 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; pxa2xx_pcm_trigger()
154 pxa2xx_pcm_pointer(struct snd_pcm_substream *substream) pxa2xx_pcm_pointer() argument
156 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_pointer()
159 dma_addr_t ptr = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? pxa2xx_pcm_pointer()
169 int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream) __pxa2xx_pcm_prepare() argument
171 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; __pxa2xx_pcm_prepare()
192 struct snd_pcm_substream *substream = dev_id; pxa2xx_pcm_dma_irq() local
199 snd_pcm_period_elapsed(substream); pxa2xx_pcm_dma_irq()
203 snd_pcm_stop_xrun(substream); pxa2xx_pcm_dma_irq()
208 int __pxa2xx_pcm_open(struct snd_pcm_substream *substream) __pxa2xx_pcm_open() argument
210 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_open()
241 dma_alloc_writecombine(substream->pcm->card->dev, PAGE_SIZE, __pxa2xx_pcm_open()
257 int __pxa2xx_pcm_close(struct snd_pcm_substream *substream) __pxa2xx_pcm_close() argument
259 struct snd_pcm_runtime *runtime = substream->runtime; __pxa2xx_pcm_close()
262 dma_free_writecombine(substream->pcm->card->dev, PAGE_SIZE, __pxa2xx_pcm_close()
269 int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream, pxa2xx_pcm_mmap() argument
272 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_mmap()
273 return dma_mmap_writecombine(substream->pcm->card->dev, vma, pxa2xx_pcm_mmap()
282 struct snd_pcm_substream *substream = pcm->streams[stream].substream; pxa2xx_pcm_preallocate_dma_buffer() local
283 struct snd_dma_buffer *buf = &substream->dma_buffer; pxa2xx_pcm_preallocate_dma_buffer()
299 struct snd_pcm_substream *substream; pxa2xx_pcm_free_dma_buffers() local
304 substream = pcm->streams[stream].substream; pxa2xx_pcm_free_dma_buffers()
305 if (!substream) pxa2xx_pcm_free_dma_buffers()
307 buf = &substream->dma_buffer; pxa2xx_pcm_free_dma_buffers()
H A Dpxa2xx-ac97.c65 static int pxa2xx_ac97_pcm_startup(struct snd_pcm_substream *substream) pxa2xx_ac97_pcm_startup() argument
67 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_ac97_pcm_startup()
74 r = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? pxa2xx_ac97_pcm_startup()
79 platform_ops = substream->pcm->card->dev->platform_data; pxa2xx_ac97_pcm_startup()
81 return platform_ops->startup(substream, platform_ops->priv); pxa2xx_ac97_pcm_startup()
86 static void pxa2xx_ac97_pcm_shutdown(struct snd_pcm_substream *substream) pxa2xx_ac97_pcm_shutdown() argument
90 platform_ops = substream->pcm->card->dev->platform_data; pxa2xx_ac97_pcm_shutdown()
92 platform_ops->shutdown(substream, platform_ops->priv); pxa2xx_ac97_pcm_shutdown()
95 static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) pxa2xx_ac97_pcm_prepare() argument
97 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_ac97_pcm_prepare()
98 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? pxa2xx_ac97_pcm_prepare()
H A Daaci.c216 if (!aacirun->substream || !aacirun->start) { aaci_fifo_irq()
263 snd_pcm_period_elapsed(aacirun->substream); aaci_fifo_irq()
276 if (!aacirun->substream || !aacirun->start) { aaci_fifo_irq()
323 snd_pcm_period_elapsed(aacirun->substream); aaci_fifo_irq()
402 static int aaci_pcm_open(struct snd_pcm_substream *substream) aaci_pcm_open() argument
404 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_open()
405 struct aaci *aaci = substream->private_data; aaci_pcm_open()
409 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { aaci_pcm_open()
415 aacirun->substream = substream; aaci_pcm_open()
421 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { aaci_pcm_open()
425 ret = snd_pcm_hw_rule_add(substream->runtime, 0, aaci_pcm_open()
459 static int aaci_pcm_close(struct snd_pcm_substream *substream) aaci_pcm_close() argument
461 struct aaci *aaci = substream->private_data; aaci_pcm_close()
462 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_close()
466 aacirun->substream = NULL; aaci_pcm_close()
476 static int aaci_pcm_hw_free(struct snd_pcm_substream *substream) aaci_pcm_hw_free() argument
478 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_hw_free()
492 snd_pcm_lib_free_pages(substream); aaci_pcm_hw_free()
504 static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, aaci_pcm_hw_params() argument
507 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_hw_params()
513 aaci_pcm_hw_free(substream); aaci_pcm_hw_params()
523 err = snd_pcm_lib_malloc_pages(substream, aaci_pcm_hw_params()
526 struct aaci *aaci = substream->private_data; aaci_pcm_hw_params()
546 static int aaci_pcm_prepare(struct snd_pcm_substream *substream) aaci_pcm_prepare() argument
548 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_prepare()
551 aacirun->period = snd_pcm_lib_period_bytes(substream); aaci_pcm_prepare()
553 aacirun->end = aacirun->start + snd_pcm_lib_buffer_bytes(substream); aaci_pcm_prepare()
560 static snd_pcm_uframes_t aaci_pcm_pointer(struct snd_pcm_substream *substream) aaci_pcm_pointer() argument
562 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_pointer()
598 static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) aaci_pcm_playback_trigger() argument
600 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_playback_trigger()
683 static int aaci_pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) aaci_pcm_capture_trigger() argument
685 struct aaci_runtime *aacirun = substream->runtime->private_data; aaci_pcm_capture_trigger()
723 static int aaci_pcm_capture_prepare(struct snd_pcm_substream *substream) aaci_pcm_capture_prepare() argument
725 struct snd_pcm_runtime *runtime = substream->runtime; aaci_pcm_capture_prepare()
726 struct aaci *aaci = substream->private_data; aaci_pcm_capture_prepare()
728 aaci_pcm_prepare(substream); aaci_pcm_capture_prepare()
/linux-4.1.27/sound/firewire/dice/
H A Ddice-pcm.c15 struct snd_pcm_substream *substream = rule->private; dice_rate_constraint() local
16 struct snd_dice *dice = substream->private_data; dice_rate_constraint()
27 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) dice_rate_constraint()
50 struct snd_pcm_substream *substream = rule->private; dice_channels_constraint() local
51 struct snd_dice *dice = substream->private_data; dice_channels_constraint()
62 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) dice_channels_constraint()
120 struct snd_pcm_substream *substream) init_hw_info()
122 struct snd_pcm_runtime *runtime = substream->runtime; init_hw_info()
135 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { init_hw_info()
149 dice_rate_constraint, substream, init_hw_info()
154 dice_channels_constraint, substream, init_hw_info()
164 static int pcm_open(struct snd_pcm_substream *substream) pcm_open() argument
166 struct snd_dice *dice = substream->private_data; pcm_open()
175 err = init_hw_info(dice, substream); pcm_open()
208 substream->runtime->hw.rate_min = rate; pcm_open()
209 substream->runtime->hw.rate_max = rate; pcm_open()
212 snd_pcm_set_sync(substream); pcm_open()
220 static int pcm_close(struct snd_pcm_substream *substream) pcm_close() argument
222 struct snd_dice *dice = substream->private_data; pcm_close()
229 static int capture_hw_params(struct snd_pcm_substream *substream, capture_hw_params() argument
232 struct snd_dice *dice = substream->private_data; capture_hw_params()
234 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { capture_hw_params()
243 return snd_pcm_lib_alloc_vmalloc_buffer(substream, capture_hw_params()
246 static int playback_hw_params(struct snd_pcm_substream *substream, playback_hw_params() argument
249 struct snd_dice *dice = substream->private_data; playback_hw_params()
251 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { playback_hw_params()
260 return snd_pcm_lib_alloc_vmalloc_buffer(substream, playback_hw_params()
264 static int capture_hw_free(struct snd_pcm_substream *substream) capture_hw_free() argument
266 struct snd_dice *dice = substream->private_data; capture_hw_free()
270 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) capture_hw_free()
277 return snd_pcm_lib_free_vmalloc_buffer(substream); capture_hw_free()
280 static int playback_hw_free(struct snd_pcm_substream *substream) playback_hw_free() argument
282 struct snd_dice *dice = substream->private_data; playback_hw_free()
286 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) playback_hw_free()
293 return snd_pcm_lib_free_vmalloc_buffer(substream); playback_hw_free()
296 static int capture_prepare(struct snd_pcm_substream *substream) capture_prepare() argument
298 struct snd_dice *dice = substream->private_data; capture_prepare()
302 err = snd_dice_stream_start_duplex(dice, substream->runtime->rate); capture_prepare()
309 static int playback_prepare(struct snd_pcm_substream *substream) playback_prepare() argument
311 struct snd_dice *dice = substream->private_data; playback_prepare()
315 err = snd_dice_stream_start_duplex(dice, substream->runtime->rate); playback_prepare()
323 static int capture_trigger(struct snd_pcm_substream *substream, int cmd) capture_trigger() argument
325 struct snd_dice *dice = substream->private_data; capture_trigger()
329 amdtp_stream_pcm_trigger(&dice->tx_stream, substream); capture_trigger()
340 static int playback_trigger(struct snd_pcm_substream *substream, int cmd) playback_trigger() argument
342 struct snd_dice *dice = substream->private_data; playback_trigger()
346 amdtp_stream_pcm_trigger(&dice->rx_stream, substream); playback_trigger()
358 static snd_pcm_uframes_t capture_pointer(struct snd_pcm_substream *substream) capture_pointer() argument
360 struct snd_dice *dice = substream->private_data; capture_pointer()
364 static snd_pcm_uframes_t playback_pointer(struct snd_pcm_substream *substream) playback_pointer() argument
366 struct snd_dice *dice = substream->private_data; playback_pointer()
119 init_hw_info(struct snd_dice *dice, struct snd_pcm_substream *substream) init_hw_info() argument
H A Ddice-midi.c10 static int midi_open(struct snd_rawmidi_substream *substream) midi_open() argument
12 struct snd_dice *dice = substream->rmidi->private_data; midi_open()
32 static int midi_close(struct snd_rawmidi_substream *substream) midi_close() argument
34 struct snd_dice *dice = substream->rmidi->private_data; midi_close()
/linux-4.1.27/include/sound/
H A Dpxa2xx-lib.h9 extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
11 extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
12 extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
13 extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
14 extern int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
16 extern int __pxa2xx_pcm_open(struct snd_pcm_substream *substream);
17 extern int __pxa2xx_pcm_close(struct snd_pcm_substream *substream);
18 extern int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
H A Drawmidi.h54 int (*open) (struct snd_rawmidi_substream * substream);
55 int (*close) (struct snd_rawmidi_substream * substream);
56 void (*trigger) (struct snd_rawmidi_substream * substream, int up);
57 void (*drain) (struct snd_rawmidi_substream * substream);
68 struct snd_rawmidi_substream *substream; member in struct:snd_rawmidi_runtime
83 void (*event)(struct snd_rawmidi_substream *substream);
88 void (*private_free)(struct snd_rawmidi_substream *substream);
92 struct list_head list; /* list of all substream for given stream */
94 int number; /* substream number */
162 int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
164 int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
165 int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
167 int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count);
168 int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
170 int __snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
172 int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream,
181 int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
183 int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
185 int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream);
186 int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream);
187 int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream);
188 long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
190 long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
H A Dpcm.h34 #define snd_pcm_substream_chip(substream) ((substream)->private_data)
67 int (*open)(struct snd_pcm_substream *substream);
68 int (*close)(struct snd_pcm_substream *substream);
69 int (*ioctl)(struct snd_pcm_substream * substream,
71 int (*hw_params)(struct snd_pcm_substream *substream,
73 int (*hw_free)(struct snd_pcm_substream *substream);
74 int (*prepare)(struct snd_pcm_substream *substream);
75 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
76 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
77 int (*get_time_info)(struct snd_pcm_substream *substream,
81 int (*copy)(struct snd_pcm_substream *substream, int channel,
84 int (*silence)(struct snd_pcm_substream *substream, int channel,
86 struct page *(*page)(struct snd_pcm_substream *substream,
88 int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
89 int (*ack)(struct snd_pcm_substream *substream);
217 struct snd_pcm_substream *substream; member in struct:snd_pcm_file
407 void (*transfer_ack_begin)(struct snd_pcm_substream *substream);
408 void (*transfer_ack_end)(struct snd_pcm_substream *substream);
450 char name[32]; /* substream name */
463 /* -- next substream -- */
467 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
496 #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
505 struct snd_pcm_substream *substream; member in struct:snd_pcm_str
570 int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
571 int snd_pcm_info_user(struct snd_pcm_substream *substream,
573 int snd_pcm_status(struct snd_pcm_substream *substream,
575 int snd_pcm_start(struct snd_pcm_substream *substream);
576 int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
577 int snd_pcm_drain_done(struct snd_pcm_substream *substream);
578 int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
580 int snd_pcm_suspend(struct snd_pcm_substream *substream);
583 int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
586 void snd_pcm_release_substream(struct snd_pcm_substream *substream);
589 void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
590 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
594 void snd_pcm_debug_name(struct snd_pcm_substream *substream,
598 snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size) snd_pcm_debug_name() argument
609 * snd_pcm_stream_linked - Check whether the substream is linked with others
610 * @substream: substream to check
612 * Returns true if the given substream is being linked with others.
614 static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream) snd_pcm_stream_linked() argument
616 return substream->group != &substream->self_group; snd_pcm_stream_linked()
619 void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
620 void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
621 void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
622 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
623 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
627 * @substream: PCM substream
634 #define snd_pcm_stream_lock_irqsave(substream, flags) \
637 flags = _snd_pcm_stream_lock_irqsave(substream); \
639 void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
645 * @substream: the substream
647 * Iterate over the all linked substreams to the given @substream.
648 * When @substream isn't linked with any others, this gives returns @substream
651 #define snd_pcm_group_for_each_entry(s, substream) \
652 list_for_each_entry(s, &substream->group->substreams, link_list)
655 * snd_pcm_running - Check whether the substream is in a running state
656 * @substream: substream to check
658 * Returns true if the given substream is in the state RUNNING, or in the
661 static inline int snd_pcm_running(struct snd_pcm_substream *substream) snd_pcm_running() argument
663 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || snd_pcm_running()
664 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && snd_pcm_running()
665 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); snd_pcm_running()
720 * @substream: PCM substream
722 static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream) snd_pcm_lib_buffer_bytes() argument
724 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_buffer_bytes()
730 * @substream: PCM substream
732 static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream) snd_pcm_lib_period_bytes() argument
734 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_lib_period_bytes()
788 * @substream: the pcm substream instance
794 static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) snd_pcm_playback_ready() argument
796 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_ready()
802 * @substream: the pcm substream instance
808 static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) snd_pcm_capture_ready() argument
810 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_ready()
816 * @substream: the pcm substream instance
823 static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) snd_pcm_playback_data() argument
825 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_data()
834 * @substream: the pcm substream instance
840 static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) snd_pcm_playback_empty() argument
842 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_playback_empty()
848 * @substream: the pcm substream instance
854 static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream) snd_pcm_capture_empty() argument
856 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_capture_empty()
861 * snd_pcm_trigger_done - Mark the master substream
862 * @substream: the pcm substream instance
863 * @master: the linked master substream
867 * in snd_pcm_group_for_each_entry() for marking the substream as "done".
869 * substream.
874 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, snd_pcm_trigger_done() argument
877 substream->runtime->trigger_master = master; snd_pcm_trigger_done()
987 int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
989 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
991 int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
992 int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
1064 void snd_pcm_set_sync(struct snd_pcm_substream *substream);
1065 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
1067 int snd_pcm_update_state(struct snd_pcm_substream *substream,
1069 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
1070 void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr);
1071 void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
1072 snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream,
1075 snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream,
1077 snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
1079 snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
1092 * @substream: PCM substream to set
1098 static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, snd_pcm_set_runtime_buffer() argument
1101 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_set_runtime_buffer()
1119 void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
1120 void snd_pcm_timer_init(struct snd_pcm_substream *substream);
1121 void snd_pcm_timer_done(struct snd_pcm_substream *substream);
1148 int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
1150 int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
1156 int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
1157 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
1159 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
1161 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
1162 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,
1166 * @substream: the substream to allocate the buffer to
1169 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
1177 (struct snd_pcm_substream *substream, size_t size) snd_pcm_lib_alloc_vmalloc_buffer()
1179 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size, snd_pcm_lib_alloc_vmalloc_buffer()
1185 * @substream: the substream to allocate the buffer to
1195 (struct snd_pcm_substream *substream, size_t size) snd_pcm_lib_alloc_vmalloc_32_buffer()
1197 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size, snd_pcm_lib_alloc_vmalloc_32_buffer()
1201 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
1207 #define snd_pcm_substream_sgbuf(substream) \
1208 snd_pcm_get_dma_buf(substream)->private_data
1210 struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
1221 * @substream: PCM substream
1225 snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) snd_pcm_sgbuf_get_addr() argument
1227 return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs); snd_pcm_sgbuf_get_addr()
1232 * @substream: PCM substream
1236 snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) snd_pcm_sgbuf_get_ptr() argument
1238 return snd_sgbuf_get_ptr(snd_pcm_get_dma_buf(substream), ofs); snd_pcm_sgbuf_get_ptr()
1244 * @substream: PCM substream
1249 snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, snd_pcm_sgbuf_get_chunk_size() argument
1252 return snd_sgbuf_get_chunk_size(snd_pcm_get_dma_buf(substream), ofs, size); snd_pcm_sgbuf_get_chunk_size()
1263 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; snd_pcm_mmap_data_open() local
1264 atomic_inc(&substream->mmap_count); snd_pcm_mmap_data_open()
1275 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; snd_pcm_mmap_data_close() local
1276 atomic_dec(&substream->mmap_count); snd_pcm_mmap_data_close()
1279 int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
1284 int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
1317 * @substream: the pcm substream instance
1321 static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
1323 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
1350 * snd_pcm_chmap_substream - get the PCM substream assigned to the given chmap info
1352 * @idx: the substream number index
1358 for (s = info->pcm->streams[info->stream].substream; s; s = s->next) snd_pcm_chmap_substream()
1176 snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, size_t size) snd_pcm_lib_alloc_vmalloc_buffer() argument
1194 snd_pcm_lib_alloc_vmalloc_32_buffer(struct snd_pcm_substream *substream, size_t size) snd_pcm_lib_alloc_vmalloc_32_buffer() argument
H A Ddmaengine_pcm.h24 * substream
25 * @substream: PCM substream
28 snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream) snd_pcm_substream_to_dma_direction() argument
30 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_substream_to_dma_direction()
36 int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream,
38 int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
39 snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream);
40 snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream);
42 int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
44 int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
46 int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
48 int snd_dmaengine_pcm_close_release_chan(struct snd_pcm_substream *substream);
52 struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream);
78 const struct snd_pcm_substream *substream,
111 * PCM substream. Will be called from the PCM drivers hwparams callback.
130 int (*prepare_slave_config)(struct snd_pcm_substream *substream,
135 struct snd_pcm_substream *substream);
153 int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
H A Dpcm-indirect.h40 typedef void (*snd_pcm_indirect_copy_t)(struct snd_pcm_substream *substream,
47 snd_pcm_indirect_playback_transfer(struct snd_pcm_substream *substream, snd_pcm_indirect_playback_transfer() argument
51 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect_playback_transfer()
75 copy(substream, rec, bytes); snd_pcm_indirect_playback_transfer()
92 snd_pcm_indirect_playback_pointer(struct snd_pcm_substream *substream, snd_pcm_indirect_playback_pointer() argument
103 if (substream->ops->ack) snd_pcm_indirect_playback_pointer()
104 substream->ops->ack(substream); snd_pcm_indirect_playback_pointer()
105 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect_playback_pointer()
113 snd_pcm_indirect_capture_transfer(struct snd_pcm_substream *substream, snd_pcm_indirect_capture_transfer() argument
117 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect_capture_transfer()
140 copy(substream, rec, bytes); snd_pcm_indirect_capture_transfer()
157 snd_pcm_indirect_capture_pointer(struct snd_pcm_substream *substream, snd_pcm_indirect_capture_pointer() argument
172 if (substream->ops->ack) snd_pcm_indirect_capture_pointer()
173 substream->ops->ack(substream); snd_pcm_indirect_capture_pointer()
174 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect_capture_pointer()
/linux-4.1.27/sound/soc/fsl/
H A Dimx-pcm-fiq.c44 struct snd_pcm_substream *substream; member in struct:imx_pcm_runtime_data
53 struct snd_pcm_substream *substream = iprtd->substream; snd_hrtimer_callback() local
61 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_hrtimer_callback()
66 snd_pcm_period_elapsed(substream); snd_hrtimer_callback()
77 static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, snd_imx_pcm_hw_params() argument
80 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_hw_params()
88 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); snd_imx_pcm_hw_params()
93 static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream) snd_imx_pcm_prepare() argument
95 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_prepare()
100 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_imx_pcm_prepare()
112 static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_imx_pcm_trigger() argument
114 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_trigger()
121 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_imx_pcm_trigger()
133 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_imx_pcm_trigger()
149 static snd_pcm_uframes_t snd_imx_pcm_pointer(struct snd_pcm_substream *substream) snd_imx_pcm_pointer() argument
151 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_pointer()
154 return bytes_to_frames(substream->runtime, iprtd->offset); snd_imx_pcm_pointer()
173 static int snd_imx_open(struct snd_pcm_substream *substream) snd_imx_open() argument
175 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_open()
184 iprtd->substream = substream; snd_imx_open()
191 ret = snd_pcm_hw_constraint_integer(substream->runtime, snd_imx_open()
198 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); snd_imx_open()
202 static int snd_imx_close(struct snd_pcm_substream *substream) snd_imx_close() argument
204 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_close()
214 static int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, snd_imx_pcm_mmap() argument
217 struct snd_pcm_runtime *runtime = substream->runtime; snd_imx_pcm_mmap()
220 ret = dma_mmap_writecombine(substream->pcm->card->dev, vma, snd_imx_pcm_mmap()
243 struct snd_pcm_substream *substream = pcm->streams[stream].substream; imx_pcm_preallocate_dma_buffer() local
244 struct snd_dma_buffer *buf = &substream->dma_buffer; imx_pcm_preallocate_dma_buffer()
269 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { imx_pcm_new()
276 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { imx_pcm_new()
291 struct snd_pcm_substream *substream; imx_pcm_fiq_new() local
298 substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; imx_pcm_fiq_new()
299 if (substream) { imx_pcm_fiq_new()
300 struct snd_dma_buffer *buf = &substream->dma_buffer; imx_pcm_fiq_new()
305 substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; imx_pcm_fiq_new()
306 if (substream) { imx_pcm_fiq_new()
307 struct snd_dma_buffer *buf = &substream->dma_buffer; imx_pcm_fiq_new()
320 struct snd_pcm_substream *substream; imx_pcm_free() local
325 substream = pcm->streams[stream].substream; imx_pcm_free()
326 if (!substream) imx_pcm_free()
329 buf = &substream->dma_buffer; imx_pcm_free()
H A Dfsl_asrc_dma.c50 struct snd_pcm_substream *substream = arg; fsl_asrc_dma_complete() local
51 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_complete()
54 pair->pos += snd_pcm_lib_period_bytes(substream); fsl_asrc_dma_complete()
55 if (pair->pos >= snd_pcm_lib_buffer_bytes(substream)) fsl_asrc_dma_complete()
58 snd_pcm_period_elapsed(substream); fsl_asrc_dma_complete()
61 static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream) fsl_asrc_dma_prepare_and_submit() argument
63 u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; fsl_asrc_dma_prepare_and_submit()
64 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_asrc_dma_prepare_and_submit()
65 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_prepare_and_submit()
71 if (!substream->runtime->no_period_wakeup) fsl_asrc_dma_prepare_and_submit()
77 snd_pcm_lib_buffer_bytes(substream), fsl_asrc_dma_prepare_and_submit()
78 snd_pcm_lib_period_bytes(substream), fsl_asrc_dma_prepare_and_submit()
86 pair->desc[!dir]->callback_param = substream; fsl_asrc_dma_prepare_and_submit()
103 static int fsl_asrc_dma_trigger(struct snd_pcm_substream *substream, int cmd) fsl_asrc_dma_trigger() argument
105 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_trigger()
113 ret = fsl_asrc_dma_prepare_and_submit(substream); fsl_asrc_dma_trigger()
132 static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, fsl_asrc_dma_hw_params() argument
136 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_asrc_dma_hw_params()
137 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; fsl_asrc_dma_hw_params()
140 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_hw_params()
146 int stream = substream->stream; fsl_asrc_dma_hw_params()
171 dev_err(dev, "failed to get the substream of Back-End\n"); fsl_asrc_dma_hw_params()
176 dma_params_fe = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); fsl_asrc_dma_hw_params()
187 ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe); fsl_asrc_dma_hw_params()
249 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); fsl_asrc_dma_hw_params()
254 static int fsl_asrc_dma_hw_free(struct snd_pcm_substream *substream) fsl_asrc_dma_hw_free() argument
256 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_hw_free()
259 snd_pcm_set_runtime_buffer(substream, NULL); fsl_asrc_dma_hw_free()
273 static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) fsl_asrc_dma_startup() argument
275 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_asrc_dma_startup()
276 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_startup()
291 snd_pcm_hw_constraint_integer(substream->runtime, fsl_asrc_dma_startup()
293 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); fsl_asrc_dma_startup()
298 static int fsl_asrc_dma_shutdown(struct snd_pcm_substream *substream) fsl_asrc_dma_shutdown() argument
300 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_shutdown()
317 static snd_pcm_uframes_t fsl_asrc_dma_pcm_pointer(struct snd_pcm_substream *substream) fsl_asrc_dma_pcm_pointer() argument
319 struct snd_pcm_runtime *runtime = substream->runtime; fsl_asrc_dma_pcm_pointer()
322 return bytes_to_frames(substream->runtime, pair->pos); fsl_asrc_dma_pcm_pointer()
338 struct snd_pcm_substream *substream; fsl_asrc_dma_pcm_new() local
349 substream = pcm->streams[i].substream; fsl_asrc_dma_pcm_new()
350 if (!substream) fsl_asrc_dma_pcm_new()
354 FSL_ASRC_DMABUF_SIZE, &substream->dma_buffer); fsl_asrc_dma_pcm_new()
364 if (--i == 0 && pcm->streams[i].substream) fsl_asrc_dma_pcm_new()
365 snd_dma_free_pages(&pcm->streams[i].substream->dma_buffer); fsl_asrc_dma_pcm_new()
372 struct snd_pcm_substream *substream; fsl_asrc_dma_pcm_free() local
376 substream = pcm->streams[i].substream; fsl_asrc_dma_pcm_free()
377 if (!substream) fsl_asrc_dma_pcm_free()
380 snd_dma_free_pages(&substream->dma_buffer); fsl_asrc_dma_pcm_free()
381 substream->dma_buffer.area = NULL; fsl_asrc_dma_pcm_free()
382 substream->dma_buffer.addr = 0; fsl_asrc_dma_pcm_free()
H A Dmpc5200_dma.c99 static int psc_dma_hw_free(struct snd_pcm_substream *substream) psc_dma_hw_free() argument
101 snd_pcm_set_runtime_buffer(substream, NULL); psc_dma_hw_free()
111 static int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd) psc_dma_trigger() argument
113 struct snd_soc_pcm_runtime *rtd = substream->private_data; psc_dma_trigger()
115 struct snd_pcm_runtime *runtime = substream->runtime; psc_dma_trigger()
116 struct psc_dma_stream *s = to_psc_dma_stream(substream, psc_dma); psc_dma_trigger()
125 substream->pstr->stream, runtime->frame_bits, psc_dma_trigger()
140 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) psc_dma_trigger()
158 substream->pstr->stream, s->period_count); psc_dma_trigger()
163 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) psc_dma_trigger()
173 substream->pstr->stream, cmd); psc_dma_trigger()
211 static int psc_dma_open(struct snd_pcm_substream *substream) psc_dma_open() argument
213 struct snd_pcm_runtime *runtime = substream->runtime; psc_dma_open()
214 struct snd_soc_pcm_runtime *rtd = substream->private_data; psc_dma_open()
219 dev_dbg(psc_dma->dev, "psc_dma_open(substream=%p)\n", substream); psc_dma_open()
221 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) psc_dma_open()
226 snd_soc_set_runtime_hwparams(substream, &psc_dma_hardware); psc_dma_open()
231 dev_err(substream->pcm->card->dev, "invalid buffer size\n"); psc_dma_open()
235 s->stream = substream; psc_dma_open()
239 static int psc_dma_close(struct snd_pcm_substream *substream) psc_dma_close() argument
241 struct snd_soc_pcm_runtime *rtd = substream->private_data; psc_dma_close()
245 dev_dbg(psc_dma->dev, "psc_dma_close(substream=%p)\n", substream); psc_dma_close()
247 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) psc_dma_close()
264 psc_dma_pointer(struct snd_pcm_substream *substream) psc_dma_pointer() argument
266 struct snd_soc_pcm_runtime *rtd = substream->private_data; psc_dma_pointer()
271 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) psc_dma_pointer()
278 return bytes_to_frames(substream->runtime, count); psc_dma_pointer()
282 psc_dma_hw_params(struct snd_pcm_substream *substream, psc_dma_hw_params() argument
285 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); psc_dma_hw_params()
316 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { psc_dma_new()
318 size, &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); psc_dma_new()
323 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { psc_dma_new()
325 size, &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer); psc_dma_new()
333 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) psc_dma_new()
334 snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); psc_dma_new()
345 struct snd_pcm_substream *substream; psc_dma_free() local
351 substream = pcm->streams[stream].substream; psc_dma_free()
352 if (substream) { psc_dma_free()
353 snd_dma_free_pages(&substream->dma_buffer); psc_dma_free()
354 substream->dma_buffer.area = NULL; psc_dma_free()
355 substream->dma_buffer.addr = 0; psc_dma_free()
H A Dfsl_dma.c75 /** fsl_dma_private: p-substream DMA data
77 * Each substream has a 1-to-1 association with a DMA channel.
86 * @substream: pointer to the substream object, needed by the ISR
100 struct snd_pcm_substream *substream; member in struct:fsl_dma_private
152 static void fsl_dma_abort_stream(struct snd_pcm_substream *substream) fsl_dma_abort_stream() argument
154 snd_pcm_stop_xrun(substream); fsl_dma_abort_stream()
172 if (dma_private->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { fsl_dma_update_pointers()
205 struct snd_pcm_substream *substream = dma_private->substream; fsl_dma_isr() local
206 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_dma_isr()
219 fsl_dma_abort_stream(substream); fsl_dma_isr()
229 fsl_dma_abort_stream(substream); fsl_dma_isr()
244 snd_pcm_period_elapsed(substream); fsl_dma_isr()
299 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { fsl_dma_new()
302 &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); fsl_dma_new()
309 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { fsl_dma_new()
312 &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer); fsl_dma_new()
315 snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); fsl_dma_new()
324 * fsl_dma_open: open a new substream.
326 * Each substream has its own DMA buffer.
385 static int fsl_dma_open(struct snd_pcm_substream *substream) fsl_dma_open() argument
387 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_open()
388 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_dma_open()
413 channel = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; fsl_dma_open()
426 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) fsl_dma_open()
434 dma_private->substream = substream; fsl_dma_open()
436 dma_private->dma_buf_phys = substream->dma_buffer.addr; fsl_dma_open()
450 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); fsl_dma_open()
451 snd_soc_set_runtime_hwparams(substream, &fsl_dma_hardware); fsl_dma_open()
505 mr |= (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? fsl_dma_open()
537 static int fsl_dma_hw_params(struct snd_pcm_substream *substream, fsl_dma_hw_params() argument
540 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_hw_params()
542 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_dma_hw_params()
562 dma_addr_t temp_addr = substream->dma_buffer.addr; fsl_dma_hw_params()
665 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { fsl_dma_hw_params()
701 static snd_pcm_uframes_t fsl_dma_pointer(struct snd_pcm_substream *substream) fsl_dma_pointer() argument
703 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_pointer()
705 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_dma_pointer()
715 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { fsl_dma_pointer()
765 static int fsl_dma_hw_free(struct snd_pcm_substream *substream) fsl_dma_hw_free() argument
767 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_hw_free()
798 static int fsl_dma_close(struct snd_pcm_substream *substream) fsl_dma_close() argument
800 struct snd_pcm_runtime *runtime = substream->runtime; fsl_dma_close()
802 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsl_dma_close()
814 substream->runtime->private_data = NULL; fsl_dma_close()
827 struct snd_pcm_substream *substream; fsl_dma_free_dma_buffers() local
831 substream = pcm->streams[i].substream; fsl_dma_free_dma_buffers()
832 if (substream) { fsl_dma_free_dma_buffers()
833 snd_dma_free_pages(&substream->dma_buffer); fsl_dma_free_dma_buffers()
834 substream->dma_buffer.area = NULL; fsl_dma_free_dma_buffers()
835 substream->dma_buffer.addr = 0; fsl_dma_free_dma_buffers()
H A Dmpc5200_psc_ac97.c141 static int psc_ac97_hw_analog_params(struct snd_pcm_substream *substream, psc_ac97_hw_analog_params() argument
146 struct psc_dma_stream *s = to_psc_dma_stream(substream, psc_dma); psc_ac97_hw_analog_params()
148 dev_dbg(psc_dma->dev, "%s(substream=%p) p_size=%i p_bytes=%i" psc_ac97_hw_analog_params()
151 __func__, substream, params_period_size(params), psc_ac97_hw_analog_params()
159 if (substream->pstr->stream != SNDRV_PCM_STREAM_CAPTURE) psc_ac97_hw_analog_params()
164 static int psc_ac97_hw_digital_params(struct snd_pcm_substream *substream, psc_ac97_hw_digital_params() argument
170 dev_dbg(psc_dma->dev, "%s(substream=%p)\n", __func__, substream); psc_ac97_hw_digital_params()
180 static int psc_ac97_trigger(struct snd_pcm_substream *substream, int cmd, psc_ac97_trigger() argument
184 struct psc_dma_stream *s = to_psc_dma_stream(substream, psc_dma); psc_ac97_trigger()
189 substream->pstr->stream); psc_ac97_trigger()
198 substream->pstr->stream); psc_ac97_trigger()
H A Dmpc5200_dma.h75 /* Utility for retrieving psc_dma_stream structure from a substream */
77 to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma) to_psc_dma_stream() argument
79 if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) to_psc_dma_stream()
/linux-4.1.27/sound/pci/ctxfi/
H A Dctpcm.c101 if (!apcm->substream) ct_atc_pcm_interrupt()
104 snd_pcm_period_elapsed(apcm->substream); ct_atc_pcm_interrupt()
110 struct ct_atc *atc = snd_pcm_substream_chip(apcm->substream); ct_atc_pcm_free_substream()
119 static int ct_pcm_playback_open(struct snd_pcm_substream *substream) ct_pcm_playback_open() argument
121 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_playback_open()
122 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_open()
130 apcm->substream = substream; ct_pcm_playback_open()
132 if (IEC958 == substream->pcm->device) { ct_pcm_playback_open()
137 if (FRONT == substream->pcm->device) ct_pcm_playback_open()
166 static int ct_pcm_playback_close(struct snd_pcm_substream *substream) ct_pcm_playback_close() argument
168 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_playback_close()
171 if (IEC958 == substream->pcm->device) ct_pcm_playback_close()
179 static int ct_pcm_hw_params(struct snd_pcm_substream *substream, ct_pcm_hw_params() argument
182 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_hw_params()
183 struct ct_atc_pcm *apcm = substream->runtime->private_data; ct_pcm_hw_params()
186 err = snd_pcm_lib_malloc_pages(substream, ct_pcm_hw_params()
195 static int ct_pcm_hw_free(struct snd_pcm_substream *substream) ct_pcm_hw_free() argument
197 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_hw_free()
198 struct ct_atc_pcm *apcm = substream->runtime->private_data; ct_pcm_hw_free()
203 return snd_pcm_lib_free_pages(substream); ct_pcm_hw_free()
207 static int ct_pcm_playback_prepare(struct snd_pcm_substream *substream) ct_pcm_playback_prepare() argument
210 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_playback_prepare()
211 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_prepare()
214 if (IEC958 == substream->pcm->device) ct_pcm_playback_prepare()
229 ct_pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) ct_pcm_playback_trigger() argument
231 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_playback_trigger()
232 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_trigger()
254 ct_pcm_playback_pointer(struct snd_pcm_substream *substream) ct_pcm_playback_pointer() argument
257 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_playback_pointer()
258 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_playback_pointer()
270 static int ct_pcm_capture_open(struct snd_pcm_substream *substream) ct_pcm_capture_open() argument
272 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_capture_open()
273 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_open()
282 apcm->substream = substream; ct_pcm_capture_open()
312 static int ct_pcm_capture_close(struct snd_pcm_substream *substream) ct_pcm_capture_close() argument
319 static int ct_pcm_capture_prepare(struct snd_pcm_substream *substream) ct_pcm_capture_prepare() argument
322 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_capture_prepare()
323 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_prepare()
337 ct_pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) ct_pcm_capture_trigger() argument
339 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_capture_trigger()
340 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_trigger()
359 ct_pcm_capture_pointer(struct snd_pcm_substream *substream) ct_pcm_capture_pointer() argument
362 struct ct_atc *atc = snd_pcm_substream_chip(substream); ct_pcm_capture_pointer()
363 struct snd_pcm_runtime *runtime = substream->runtime; ct_pcm_capture_pointer()
H A Dcttimer.c37 struct snd_pcm_substream *substream; member in struct:ct_timer_instance
69 struct snd_pcm_substream *substream = ti->substream; ct_systimer_callback() local
70 struct snd_pcm_runtime *runtime = substream->runtime; ct_systimer_callback()
77 position = substream->ops->pointer(substream); ct_systimer_callback()
102 struct snd_pcm_runtime *runtime = ti->substream->runtime; ct_systimer_start()
206 period_size = ti->substream->runtime->period_size; ct_xfitimer_reprogram()
207 rate = ti->substream->runtime->rate; ct_xfitimer_reprogram()
208 pos = ti->substream->ops->pointer(ti->substream); ct_xfitimer_reprogram()
269 ti->frag_count = ti->substream->runtime->period_size; ct_xfitimer_prepare()
350 ti->substream = apcm->substream; ct_timer_instance_new()
/linux-4.1.27/sound/firewire/oxfw/
H A Doxfw-pcm.c122 struct snd_pcm_substream *substream) init_hw_params()
124 struct snd_pcm_runtime *runtime = substream->runtime; init_hw_params()
136 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { init_hw_params()
166 static int limit_to_current_params(struct snd_pcm_substream *substream) limit_to_current_params() argument
168 struct snd_oxfw *oxfw = substream->private_data; limit_to_current_params()
173 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) limit_to_current_params()
182 substream->runtime->hw.channels_min = formation.pcm; limit_to_current_params()
183 substream->runtime->hw.channels_max = formation.pcm; limit_to_current_params()
184 substream->runtime->hw.rate_min = formation.rate; limit_to_current_params()
185 substream->runtime->hw.rate_max = formation.rate; limit_to_current_params()
190 static int pcm_open(struct snd_pcm_substream *substream) pcm_open() argument
192 struct snd_oxfw *oxfw = substream->private_data; pcm_open()
199 err = init_hw_params(oxfw, substream); pcm_open()
209 err = limit_to_current_params(substream); pcm_open()
214 snd_pcm_set_sync(substream); pcm_open()
222 static int pcm_close(struct snd_pcm_substream *substream) pcm_close() argument
224 struct snd_oxfw *oxfw = substream->private_data; pcm_close()
230 static int pcm_capture_hw_params(struct snd_pcm_substream *substream, pcm_capture_hw_params() argument
233 struct snd_oxfw *oxfw = substream->private_data; pcm_capture_hw_params()
236 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { pcm_capture_hw_params()
244 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_capture_hw_params()
247 static int pcm_playback_hw_params(struct snd_pcm_substream *substream, pcm_playback_hw_params() argument
250 struct snd_oxfw *oxfw = substream->private_data; pcm_playback_hw_params()
252 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { pcm_playback_hw_params()
260 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_playback_hw_params()
264 static int pcm_capture_hw_free(struct snd_pcm_substream *substream) pcm_capture_hw_free() argument
266 struct snd_oxfw *oxfw = substream->private_data; pcm_capture_hw_free()
270 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
277 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_capture_hw_free()
279 static int pcm_playback_hw_free(struct snd_pcm_substream *substream) pcm_playback_hw_free() argument
281 struct snd_oxfw *oxfw = substream->private_data; pcm_playback_hw_free()
285 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
292 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_playback_hw_free()
295 static int pcm_capture_prepare(struct snd_pcm_substream *substream) pcm_capture_prepare() argument
297 struct snd_oxfw *oxfw = substream->private_data; pcm_capture_prepare()
298 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare()
312 static int pcm_playback_prepare(struct snd_pcm_substream *substream) pcm_playback_prepare() argument
314 struct snd_oxfw *oxfw = substream->private_data; pcm_playback_prepare()
315 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare()
330 static int pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) pcm_capture_trigger() argument
332 struct snd_oxfw *oxfw = substream->private_data; pcm_capture_trigger()
337 pcm = substream; pcm_capture_trigger()
348 static int pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) pcm_playback_trigger() argument
350 struct snd_oxfw *oxfw = substream->private_data; pcm_playback_trigger()
355 pcm = substream; pcm_playback_trigger()
121 init_hw_params(struct snd_oxfw *oxfw, struct snd_pcm_substream *substream) init_hw_params() argument
H A Doxfw-midi.c11 static int midi_capture_open(struct snd_rawmidi_substream *substream) midi_capture_open() argument
13 struct snd_oxfw *oxfw = substream->rmidi->private_data; midi_capture_open()
33 static int midi_playback_open(struct snd_rawmidi_substream *substream) midi_playback_open() argument
35 struct snd_oxfw *oxfw = substream->rmidi->private_data; midi_playback_open()
55 static int midi_capture_close(struct snd_rawmidi_substream *substream) midi_capture_close() argument
57 struct snd_oxfw *oxfw = substream->rmidi->private_data; midi_capture_close()
70 static int midi_playback_close(struct snd_rawmidi_substream *substream) midi_playback_close() argument
72 struct snd_oxfw *oxfw = substream->rmidi->private_data; midi_playback_close()
/linux-4.1.27/sound/soc/blackfin/
H A Dbf5xx-i2s-pcm.c63 static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream, bf5xx_pcm_hw_params() argument
66 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_hw_params()
70 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_hw_params()
75 return snd_pcm_lib_malloc_pages(substream, buffer_size); bf5xx_pcm_hw_params()
78 static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream) bf5xx_pcm_hw_free() argument
80 snd_pcm_lib_free_pages(substream); bf5xx_pcm_hw_free()
85 static int bf5xx_pcm_prepare(struct snd_pcm_substream *substream) bf5xx_pcm_prepare() argument
87 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_prepare()
88 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_prepare()
93 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_prepare()
99 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_prepare()
100 sport_set_tx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
104 sport_set_rx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
112 static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) bf5xx_pcm_trigger() argument
114 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_trigger()
121 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_trigger()
129 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_trigger()
141 static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream) bf5xx_pcm_pointer() argument
143 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_pointer()
144 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_pointer()
150 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_pointer()
153 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_pointer()
164 if (diff == snd_pcm_lib_buffer_bytes(substream)) bf5xx_pcm_pointer()
167 frames = bytes_to_frames(substream->runtime, diff); bf5xx_pcm_pointer()
174 static int bf5xx_pcm_open(struct snd_pcm_substream *substream) bf5xx_pcm_open() argument
176 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_open()
179 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_open()
180 struct snd_dma_buffer *buf = &substream->dma_buffer; bf5xx_pcm_open()
184 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_open()
188 snd_soc_set_runtime_hwparams(substream, &bf5xx_pcm_hardware); bf5xx_pcm_open()
200 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_open()
216 static int bf5xx_pcm_mmap(struct snd_pcm_substream *substream, bf5xx_pcm_mmap() argument
219 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_mmap()
228 static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, bf5xx_pcm_copy() argument
231 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_copy()
232 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_copy()
238 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_copy()
241 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_copy()
269 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_copy()
285 static int bf5xx_pcm_silence(struct snd_pcm_substream *substream, bf5xx_pcm_silence() argument
288 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_silence()
289 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_silence()
295 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); bf5xx_pcm_silence()
H A Dbf5xx-ac97-pcm.c55 static void bf5xx_mmap_copy(struct snd_pcm_substream *substream, bf5xx_mmap_copy() argument
58 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_mmap_copy()
61 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_mmap_copy()
118 static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream, bf5xx_pcm_hw_params() argument
124 snd_pcm_lib_malloc_pages(substream, size); bf5xx_pcm_hw_params()
129 static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream) bf5xx_pcm_hw_free() argument
132 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_hw_free()
135 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_hw_free()
145 snd_pcm_lib_free_pages(substream); bf5xx_pcm_hw_free()
149 static int bf5xx_pcm_prepare(struct snd_pcm_substream *substream) bf5xx_pcm_prepare() argument
151 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_prepare()
158 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_prepare()
159 sport_set_tx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
163 sport_set_rx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
168 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_prepare()
169 sport_set_tx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
173 sport_set_rx_callback(sport, bf5xx_dma_irq, substream); bf5xx_pcm_prepare()
181 static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) bf5xx_pcm_trigger() argument
183 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_trigger()
190 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_trigger()
192 bf5xx_mmap_copy(substream, runtime->period_size); bf5xx_pcm_trigger()
202 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_trigger()
220 static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream) bf5xx_pcm_pointer() argument
222 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_pointer()
227 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_pointer()
233 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_pointer()
242 static int bf5xx_pcm_open(struct snd_pcm_substream *substream) bf5xx_pcm_open() argument
244 struct snd_soc_pcm_runtime *rtd = substream->private_data; bf5xx_pcm_open()
247 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_open()
251 snd_soc_set_runtime_hwparams(substream, &bf5xx_pcm_hardware); bf5xx_pcm_open()
271 static int bf5xx_pcm_mmap(struct snd_pcm_substream *substream, bf5xx_pcm_mmap() argument
274 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_mmap()
282 static int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel, bf5xx_pcm_copy() argument
286 struct snd_pcm_runtime *runtime = substream->runtime; bf5xx_pcm_copy()
289 substream->stream ? "Capture" : "Playback", pos, count); bf5xx_pcm_copy()
291 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) bf5xx_pcm_copy()
321 struct snd_pcm_substream *substream = pcm->streams[stream].substream; bf5xx_pcm_preallocate_dma_buffer() local
322 struct snd_dma_buffer *buf = &substream->dma_buffer; bf5xx_pcm_preallocate_dma_buffer()
351 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_preallocate_dma_buffer()
380 struct snd_pcm_substream *substream; bf5xx_pcm_free_dma_buffers() local
391 substream = pcm->streams[stream].substream; bf5xx_pcm_free_dma_buffers()
392 if (!substream) bf5xx_pcm_free_dma_buffers()
395 buf = &substream->dma_buffer; bf5xx_pcm_free_dma_buffers()
401 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { bf5xx_pcm_free_dma_buffers()
428 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { bf5xx_pcm_ac97_new()
435 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { bf5xx_pcm_ac97_new()
H A Dbfin-eval-adau1701.c36 static int bfin_eval_adau1701_hw_params(struct snd_pcm_substream *substream, bfin_eval_adau1701_hw_params() argument
39 struct snd_soc_pcm_runtime *rtd = substream->private_data; bfin_eval_adau1701_hw_params()
H A Dbfin-eval-adau1x61.c51 static int bfin_eval_adau1x61_hw_params(struct snd_pcm_substream *substream, bfin_eval_adau1x61_hw_params() argument
54 struct snd_soc_pcm_runtime *rtd = substream->private_data; bfin_eval_adau1x61_hw_params()
H A Dbfin-eval-adau1x81.c39 static int bfin_eval_adau1x81_hw_params(struct snd_pcm_substream *substream, bfin_eval_adau1x81_hw_params() argument
42 struct snd_soc_pcm_runtime *rtd = substream->private_data; bfin_eval_adau1x81_hw_params()
/linux-4.1.27/sound/soc/samsung/
H A Didma.c71 static int idma_enqueue(struct snd_pcm_substream *substream) idma_enqueue() argument
73 struct snd_pcm_runtime *runtime = substream->runtime; idma_enqueue()
74 struct idma_ctrl *prtd = substream->runtime->private_data; idma_enqueue()
78 prtd->token = (void *) substream; idma_enqueue()
106 static void idma_setcallbk(struct snd_pcm_substream *substream, idma_setcallbk() argument
109 struct idma_ctrl *prtd = substream->runtime->private_data; idma_setcallbk()
140 struct snd_pcm_substream *substream = id; idma_done() local
141 struct idma_ctrl *prtd = substream->runtime->private_data; idma_done()
144 snd_pcm_period_elapsed(substream); idma_done()
147 static int idma_hw_params(struct snd_pcm_substream *substream, idma_hw_params() argument
150 struct snd_pcm_runtime *runtime = substream->runtime; idma_hw_params()
151 struct idma_ctrl *prtd = substream->runtime->private_data; idma_hw_params()
160 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); idma_hw_params()
168 idma_setcallbk(substream, idma_done); idma_hw_params()
173 static int idma_hw_free(struct snd_pcm_substream *substream) idma_hw_free() argument
175 snd_pcm_set_runtime_buffer(substream, NULL); idma_hw_free()
180 static int idma_prepare(struct snd_pcm_substream *substream) idma_prepare() argument
182 struct idma_ctrl *prtd = substream->runtime->private_data; idma_prepare()
188 idma_enqueue(substream); idma_prepare()
193 static int idma_trigger(struct snd_pcm_substream *substream, int cmd) idma_trigger() argument
195 struct idma_ctrl *prtd = substream->runtime->private_data; idma_trigger()
226 idma_pointer(struct snd_pcm_substream *substream) idma_pointer() argument
228 struct snd_pcm_runtime *runtime = substream->runtime; idma_pointer()
240 return bytes_to_frames(substream->runtime, res); idma_pointer()
243 static int idma_mmap(struct snd_pcm_substream *substream, idma_mmap() argument
246 struct snd_pcm_runtime *runtime = substream->runtime; idma_mmap()
288 static int idma_open(struct snd_pcm_substream *substream) idma_open() argument
290 struct snd_pcm_runtime *runtime = substream->runtime; idma_open()
294 snd_soc_set_runtime_hwparams(substream, &idma_hardware); idma_open()
314 static int idma_close(struct snd_pcm_substream *substream) idma_close() argument
316 struct snd_pcm_runtime *runtime = substream->runtime; idma_close()
343 struct snd_pcm_substream *substream; idma_free() local
346 substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; idma_free()
347 if (!substream) idma_free()
350 buf = &substream->dma_buffer; idma_free()
362 struct snd_pcm_substream *substream = pcm->streams[stream].substream; preallocate_idma_buffer() local
363 struct snd_dma_buffer *buf = &substream->dma_buffer; preallocate_idma_buffer()
387 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { idma_new()
H A Drx1950_uda1380.c35 static int rx1950_startup(struct snd_pcm_substream *substream);
36 static int rx1950_hw_params(struct snd_pcm_substream *substream,
134 static int rx1950_startup(struct snd_pcm_substream *substream) rx1950_startup() argument
136 struct snd_pcm_runtime *runtime = substream->runtime; rx1950_startup()
154 static int rx1950_hw_params(struct snd_pcm_substream *substream, rx1950_hw_params() argument
157 struct snd_soc_pcm_runtime *rtd = substream->private_data; rx1950_hw_params()
H A Dneo1973_wm8753.c30 static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream, neo1973_hifi_hw_params() argument
33 struct snd_soc_pcm_runtime *rtd = substream->private_data; neo1973_hifi_hw_params()
105 static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream) neo1973_hifi_hw_free() argument
107 struct snd_soc_pcm_runtime *rtd = substream->private_data; neo1973_hifi_hw_free()
122 static int neo1973_voice_hw_params(struct snd_pcm_substream *substream, neo1973_voice_hw_params() argument
125 struct snd_soc_pcm_runtime *rtd = substream->private_data; neo1973_voice_hw_params()
160 static int neo1973_voice_hw_free(struct snd_pcm_substream *substream) neo1973_voice_hw_free() argument
162 struct snd_soc_pcm_runtime *rtd = substream->private_data; neo1973_voice_hw_free()
H A Dh1940_uda1380.c65 static int h1940_startup(struct snd_pcm_substream *substream) h1940_startup() argument
67 struct snd_pcm_runtime *runtime = substream->runtime; h1940_startup()
74 static int h1940_hw_params(struct snd_pcm_substream *substream, h1940_hw_params() argument
77 struct snd_soc_pcm_runtime *rtd = substream->private_data; h1940_hw_params()
/linux-4.1.27/sound/soc/pxa/
H A Dmmp-pcm.c61 static int mmp_pcm_hw_params(struct snd_pcm_substream *substream, mmp_pcm_hw_params() argument
64 struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); mmp_pcm_hw_params()
69 snd_dmaengine_pcm_prepare_slave_config(substream, params, mmp_pcm_hw_params()
78 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); mmp_pcm_hw_params()
100 static int mmp_pcm_open(struct snd_pcm_substream *substream) mmp_pcm_open() argument
102 struct snd_soc_pcm_runtime *rtd = substream->private_data; mmp_pcm_open()
108 r = platform_get_resource(pdev, IORESOURCE_DMA, substream->stream); mmp_pcm_open()
112 snd_soc_set_runtime_hwparams(substream, mmp_pcm_open()
113 &mmp_pcm_hardware[substream->stream]); mmp_pcm_open()
118 return snd_dmaengine_pcm_open_request_chan(substream, filter, mmp_pcm_open()
122 static int mmp_pcm_mmap(struct snd_pcm_substream *substream, mmp_pcm_mmap() argument
125 struct snd_pcm_runtime *runtime = substream->runtime; mmp_pcm_mmap()
146 struct snd_pcm_substream *substream; mmp_pcm_free_dma_buffers() local
158 substream = pcm->streams[stream].substream; mmp_pcm_free_dma_buffers()
159 if (!substream) mmp_pcm_free_dma_buffers()
162 buf = &substream->dma_buffer; mmp_pcm_free_dma_buffers()
172 static int mmp_pcm_preallocate_dma_buffer(struct snd_pcm_substream *substream, mmp_pcm_preallocate_dma_buffer() argument
175 struct snd_dma_buffer *buf = &substream->dma_buffer; mmp_pcm_preallocate_dma_buffer()
180 buf->dev.dev = substream->pcm->card->dev; mmp_pcm_preallocate_dma_buffer()
196 struct snd_pcm_substream *substream; mmp_pcm_new() local
201 substream = pcm->streams[stream].substream; mmp_pcm_new()
203 ret = mmp_pcm_preallocate_dma_buffer(substream, stream); mmp_pcm_new()
H A Dpxa2xx-pcm.c27 static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, pxa2xx_pcm_hw_params() argument
30 struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_pcm_hw_params()
32 struct snd_soc_pcm_runtime *rtd = substream->private_data; pxa2xx_pcm_hw_params()
36 dma = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); pxa2xx_pcm_hw_params()
48 pxa2xx_pcm_dma_irq, substream); pxa2xx_pcm_hw_params()
56 pxa2xx_pcm_dma_irq, substream); pxa2xx_pcm_hw_params()
62 return __pxa2xx_pcm_hw_params(substream, params); pxa2xx_pcm_hw_params()
65 static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream) pxa2xx_pcm_hw_free() argument
67 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; pxa2xx_pcm_hw_free()
69 __pxa2xx_pcm_hw_free(substream); pxa2xx_pcm_hw_free()
102 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { pxa2xx_soc_pcm_new()
109 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { pxa2xx_soc_pcm_new()
H A Dpxa2xx-ac97.c92 static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, pxa2xx_ac97_hw_params() argument
98 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_ac97_hw_params()
103 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data); pxa2xx_ac97_hw_params()
108 static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream, pxa2xx_ac97_hw_aux_params() argument
114 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_ac97_hw_aux_params()
119 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data); pxa2xx_ac97_hw_aux_params()
124 static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream, pxa2xx_ac97_hw_mic_params() argument
128 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_ac97_hw_mic_params()
131 snd_soc_dai_set_dma_data(cpu_dai, substream, pxa2xx_ac97_hw_mic_params()
H A Draumfeld.c67 static int raumfeld_cs4270_startup(struct snd_pcm_substream *substream) raumfeld_cs4270_startup() argument
69 struct snd_soc_pcm_runtime *rtd = substream->private_data; raumfeld_cs4270_startup()
76 static void raumfeld_cs4270_shutdown(struct snd_pcm_substream *substream) raumfeld_cs4270_shutdown() argument
78 struct snd_soc_pcm_runtime *rtd = substream->private_data; raumfeld_cs4270_shutdown()
85 static int raumfeld_cs4270_hw_params(struct snd_pcm_substream *substream, raumfeld_cs4270_hw_params() argument
88 struct snd_soc_pcm_runtime *rtd = substream->private_data; raumfeld_cs4270_hw_params()
155 static int raumfeld_ak4104_hw_params(struct snd_pcm_substream *substream, raumfeld_ak4104_hw_params() argument
158 struct snd_soc_pcm_runtime *rtd = substream->private_data; raumfeld_ak4104_hw_params()
H A Dpxa2xx-i2s.c101 static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream, pxa2xx_i2s_startup() argument
104 struct snd_soc_pcm_runtime *rtd = substream->private_data; pxa2xx_i2s_startup()
162 static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, pxa2xx_i2s_hw_params() argument
174 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_i2s_hw_params()
179 snd_soc_dai_set_dma_data(dai, substream, dma_data); pxa2xx_i2s_hw_params()
190 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_i2s_hw_params()
222 static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, pxa2xx_i2s_trigger() argument
229 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) pxa2xx_i2s_trigger()
248 static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream, pxa2xx_i2s_shutdown() argument
251 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { pxa2xx_i2s_shutdown()
H A Dmmp-sspa.c103 static int mmp_sspa_startup(struct snd_pcm_substream *substream, mmp_sspa_startup() argument
114 static void mmp_sspa_shutdown(struct snd_pcm_substream *substream, mmp_sspa_shutdown() argument
264 static int mmp_sspa_hw_params(struct snd_pcm_substream *substream, mmp_sspa_hw_params() argument
268 struct snd_soc_pcm_runtime *rtd = substream->private_data; mmp_sspa_hw_params()
275 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) mmp_sspa_hw_params()
306 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { mmp_sspa_hw_params()
314 dma_params = &sspa_priv->dma_params[substream->stream]; mmp_sspa_hw_params()
315 dma_params->addr = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? mmp_sspa_hw_params()
318 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_params); mmp_sspa_hw_params()
322 static int mmp_sspa_trigger(struct snd_pcm_substream *substream, int cmd, mmp_sspa_trigger() argument
342 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) mmp_sspa_trigger()
353 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) mmp_sspa_trigger()
H A Dimote2.c10 static int imote2_asoc_hw_params(struct snd_pcm_substream *substream, imote2_asoc_hw_params() argument
13 struct snd_soc_pcm_runtime *rtd = substream->private_data; imote2_asoc_hw_params()
H A Dpxa-ssp.c91 static int pxa_ssp_startup(struct snd_pcm_substream *substream, pxa_ssp_startup() argument
108 dma->filter_data = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? pxa_ssp_startup()
111 snd_soc_dai_set_dma_data(cpu_dai, substream, dma); pxa_ssp_startup()
116 static void pxa_ssp_shutdown(struct snd_pcm_substream *substream, pxa_ssp_shutdown() argument
127 kfree(snd_soc_dai_get_dma_data(cpu_dai, substream)); pxa_ssp_shutdown()
128 snd_soc_dai_set_dma_data(cpu_dai, substream, NULL); pxa_ssp_shutdown()
541 static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, pxa_ssp_hw_params() argument
554 dma_data = snd_soc_dai_get_dma_data(cpu_dai, substream); pxa_ssp_hw_params()
562 substream->stream == SNDRV_PCM_STREAM_PLAYBACK, dma_data); pxa_ssp_hw_params()
639 static void pxa_ssp_set_running_bit(struct snd_pcm_substream *substream, pxa_ssp_set_running_bit() argument
650 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { pxa_ssp_set_running_bit()
671 static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd, pxa_ssp_trigger() argument
684 pxa_ssp_set_running_bit(substream, ssp, 1); pxa_ssp_trigger()
689 pxa_ssp_set_running_bit(substream, ssp, 1); pxa_ssp_trigger()
692 pxa_ssp_set_running_bit(substream, ssp, 0); pxa_ssp_trigger()
698 pxa_ssp_set_running_bit(substream, ssp, 0); pxa_ssp_trigger()
/linux-4.1.27/sound/drivers/pcsp/
H A Dpcsp_lib.c31 struct snd_pcm_substream *substream; pcsp_call_pcm_elapsed() local
32 substream = pcsp_chip.playback_substream; pcsp_call_pcm_elapsed()
33 if (substream) pcsp_call_pcm_elapsed()
34 snd_pcm_period_elapsed(substream); pcsp_call_pcm_elapsed()
47 struct snd_pcm_substream *substream; pcsp_timer_update() local
57 substream = chip->playback_substream; pcsp_timer_update()
58 if (!substream) pcsp_timer_update()
61 runtime = substream->runtime; pcsp_timer_update()
89 struct snd_pcm_substream *substream; pcsp_pointer_update() local
95 substream = chip->playback_substream; pcsp_pointer_update()
96 if (!substream) pcsp_pointer_update()
99 period_bytes = snd_pcm_lib_period_bytes(substream); pcsp_pointer_update()
100 buffer_bytes = snd_pcm_lib_buffer_bytes(substream); pcsp_pointer_update()
201 static int snd_pcsp_playback_close(struct snd_pcm_substream *substream) snd_pcsp_playback_close() argument
203 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_close()
212 static int snd_pcsp_playback_hw_params(struct snd_pcm_substream *substream, snd_pcsp_playback_hw_params() argument
215 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_hw_params()
218 err = snd_pcm_lib_malloc_pages(substream, snd_pcsp_playback_hw_params()
225 static int snd_pcsp_playback_hw_free(struct snd_pcm_substream *substream) snd_pcsp_playback_hw_free() argument
227 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_hw_free()
232 return snd_pcm_lib_free_pages(substream); snd_pcsp_playback_hw_free()
235 static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream) snd_pcsp_playback_prepare() argument
237 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_prepare()
242 snd_pcm_format_physical_width(substream->runtime->format) >> 3; snd_pcsp_playback_prepare()
243 chip->is_signed = snd_pcm_format_signed(substream->runtime->format); snd_pcsp_playback_prepare()
247 snd_pcm_lib_buffer_bytes(substream), snd_pcsp_playback_prepare()
248 snd_pcm_lib_period_bytes(substream), snd_pcsp_playback_prepare()
249 snd_pcm_lib_buffer_bytes(substream) / snd_pcsp_playback_prepare()
250 snd_pcm_lib_period_bytes(substream), snd_pcsp_playback_prepare()
251 substream->runtime->periods, snd_pcsp_playback_prepare()
257 static int snd_pcsp_trigger(struct snd_pcm_substream *substream, int cmd) snd_pcsp_trigger() argument
259 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_trigger()
278 *substream) snd_pcsp_playback_pointer()
280 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_pointer()
285 return bytes_to_frames(substream->runtime, pos); snd_pcsp_playback_pointer()
310 static int snd_pcsp_playback_open(struct snd_pcm_substream *substream) snd_pcsp_playback_open() argument
312 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); snd_pcsp_playback_open()
313 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcsp_playback_open()
322 chip->playback_substream = substream; snd_pcsp_playback_open()
277 snd_pcsp_playback_pointer(struct snd_pcm_substream *substream) snd_pcsp_playback_pointer() argument
/linux-4.1.27/sound/firewire/bebob/
H A Dbebob_pcm.c110 struct snd_pcm_substream *substream) pcm_init_hw_params()
112 struct snd_pcm_runtime *runtime = substream->runtime; pcm_init_hw_params()
124 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { pcm_init_hw_params()
155 pcm_open(struct snd_pcm_substream *substream) pcm_open() argument
157 struct snd_bebob *bebob = substream->private_data; pcm_open()
167 err = pcm_init_hw_params(bebob, substream); pcm_open()
189 substream->runtime->hw.rate_min = sampling_rate; pcm_open()
190 substream->runtime->hw.rate_max = sampling_rate; pcm_open()
193 snd_pcm_set_sync(substream); pcm_open()
202 pcm_close(struct snd_pcm_substream *substream) pcm_close() argument
204 struct snd_bebob *bebob = substream->private_data; pcm_close()
210 pcm_capture_hw_params(struct snd_pcm_substream *substream, pcm_capture_hw_params() argument
213 struct snd_bebob *bebob = substream->private_data; pcm_capture_hw_params()
215 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_capture_hw_params()
219 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_capture_hw_params()
223 pcm_playback_hw_params(struct snd_pcm_substream *substream, pcm_playback_hw_params() argument
226 struct snd_bebob *bebob = substream->private_data; pcm_playback_hw_params()
228 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_playback_hw_params()
232 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_playback_hw_params()
237 pcm_capture_hw_free(struct snd_pcm_substream *substream) pcm_capture_hw_free() argument
239 struct snd_bebob *bebob = substream->private_data; pcm_capture_hw_free()
241 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
246 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_capture_hw_free()
249 pcm_playback_hw_free(struct snd_pcm_substream *substream) pcm_playback_hw_free() argument
251 struct snd_bebob *bebob = substream->private_data; pcm_playback_hw_free()
253 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
258 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_playback_hw_free()
262 pcm_capture_prepare(struct snd_pcm_substream *substream) pcm_capture_prepare() argument
264 struct snd_bebob *bebob = substream->private_data; pcm_capture_prepare()
265 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare()
275 pcm_playback_prepare(struct snd_pcm_substream *substream) pcm_playback_prepare() argument
277 struct snd_bebob *bebob = substream->private_data; pcm_playback_prepare()
278 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare()
289 pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) pcm_capture_trigger() argument
291 struct snd_bebob *bebob = substream->private_data; pcm_capture_trigger()
295 amdtp_stream_pcm_trigger(&bebob->tx_stream, substream); pcm_capture_trigger()
307 pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) pcm_playback_trigger() argument
309 struct snd_bebob *bebob = substream->private_data; pcm_playback_trigger()
313 amdtp_stream_pcm_trigger(&bebob->rx_stream, substream); pcm_playback_trigger()
109 pcm_init_hw_params(struct snd_bebob *bebob, struct snd_pcm_substream *substream) pcm_init_hw_params() argument
H A Dbebob_midi.c11 static int midi_capture_open(struct snd_rawmidi_substream *substream) midi_capture_open() argument
13 struct snd_bebob *bebob = substream->rmidi->private_data; midi_capture_open()
28 static int midi_playback_open(struct snd_rawmidi_substream *substream) midi_playback_open() argument
30 struct snd_bebob *bebob = substream->rmidi->private_data; midi_playback_open()
45 static int midi_capture_close(struct snd_rawmidi_substream *substream) midi_capture_close() argument
47 struct snd_bebob *bebob = substream->rmidi->private_data; midi_capture_close()
56 static int midi_playback_close(struct snd_rawmidi_substream *substream) midi_playback_close() argument
58 struct snd_bebob *bebob = substream->rmidi->private_data; midi_playback_close()
/linux-4.1.27/sound/firewire/fireworks/
H A Dfireworks_pcm.c147 struct snd_pcm_substream *substream) pcm_init_hw_params()
149 struct snd_pcm_runtime *runtime = substream->runtime; pcm_init_hw_params()
161 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { pcm_init_hw_params()
195 static int pcm_open(struct snd_pcm_substream *substream) pcm_open() argument
197 struct snd_efw *efw = substream->private_data; pcm_open()
206 err = pcm_init_hw_params(efw, substream); pcm_open()
224 substream->runtime->hw.rate_min = sampling_rate; pcm_open()
225 substream->runtime->hw.rate_max = sampling_rate; pcm_open()
228 snd_pcm_set_sync(substream); pcm_open()
236 static int pcm_close(struct snd_pcm_substream *substream) pcm_close() argument
238 struct snd_efw *efw = substream->private_data; pcm_close()
243 static int pcm_capture_hw_params(struct snd_pcm_substream *substream, pcm_capture_hw_params() argument
246 struct snd_efw *efw = substream->private_data; pcm_capture_hw_params()
248 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_capture_hw_params()
252 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_capture_hw_params()
255 static int pcm_playback_hw_params(struct snd_pcm_substream *substream, pcm_playback_hw_params() argument
258 struct snd_efw *efw = substream->private_data; pcm_playback_hw_params()
260 if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) pcm_playback_hw_params()
264 return snd_pcm_lib_alloc_vmalloc_buffer(substream, pcm_playback_hw_params()
268 static int pcm_capture_hw_free(struct snd_pcm_substream *substream) pcm_capture_hw_free() argument
270 struct snd_efw *efw = substream->private_data; pcm_capture_hw_free()
272 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_capture_hw_free()
277 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_capture_hw_free()
279 static int pcm_playback_hw_free(struct snd_pcm_substream *substream) pcm_playback_hw_free() argument
281 struct snd_efw *efw = substream->private_data; pcm_playback_hw_free()
283 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) pcm_playback_hw_free()
288 return snd_pcm_lib_free_vmalloc_buffer(substream); pcm_playback_hw_free()
291 static int pcm_capture_prepare(struct snd_pcm_substream *substream) pcm_capture_prepare() argument
293 struct snd_efw *efw = substream->private_data; pcm_capture_prepare()
294 struct snd_pcm_runtime *runtime = substream->runtime; pcm_capture_prepare()
303 static int pcm_playback_prepare(struct snd_pcm_substream *substream) pcm_playback_prepare() argument
305 struct snd_efw *efw = substream->private_data; pcm_playback_prepare()
306 struct snd_pcm_runtime *runtime = substream->runtime; pcm_playback_prepare()
316 static int pcm_capture_trigger(struct snd_pcm_substream *substream, int cmd) pcm_capture_trigger() argument
318 struct snd_efw *efw = substream->private_data; pcm_capture_trigger()
322 amdtp_stream_pcm_trigger(&efw->tx_stream, substream); pcm_capture_trigger()
333 static int pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) pcm_playback_trigger() argument
335 struct snd_efw *efw = substream->private_data; pcm_playback_trigger()
339 amdtp_stream_pcm_trigger(&efw->rx_stream, substream); pcm_playback_trigger()
146 pcm_init_hw_params(struct snd_efw *efw, struct snd_pcm_substream *substream) pcm_init_hw_params() argument
H A Dfireworks_midi.c11 static int midi_capture_open(struct snd_rawmidi_substream *substream) midi_capture_open() argument
13 struct snd_efw *efw = substream->rmidi->private_data; midi_capture_open()
29 static int midi_playback_open(struct snd_rawmidi_substream *substream) midi_playback_open() argument
31 struct snd_efw *efw = substream->rmidi->private_data; midi_playback_open()
46 static int midi_capture_close(struct snd_rawmidi_substream *substream) midi_capture_close() argument
48 struct snd_efw *efw = substream->rmidi->private_data; midi_capture_close()
57 static int midi_playback_close(struct snd_rawmidi_substream *substream) midi_playback_close() argument
59 struct snd_efw *efw = substream->rmidi->private_data; midi_playback_close()
/linux-4.1.27/sound/soc/nuc900/
H A Dnuc900-pcm.c42 static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, nuc900_dma_hw_params() argument
45 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); nuc900_dma_hw_params()
48 static void nuc900_update_dma_register(struct snd_pcm_substream *substream) nuc900_update_dma_register() argument
50 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_update_dma_register()
54 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { nuc900_update_dma_register()
66 static void nuc900_dma_start(struct snd_pcm_substream *substream) nuc900_dma_start() argument
68 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_start()
77 static void nuc900_dma_stop(struct snd_pcm_substream *substream) nuc900_dma_stop() argument
79 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_stop()
90 struct snd_pcm_substream *substream = dev_id; nuc900_dma_interrupt() local
91 struct nuc900_audio *nuc900_audio = substream->runtime->private_data; nuc900_dma_interrupt()
134 snd_pcm_period_elapsed(substream); nuc900_dma_interrupt()
139 static int nuc900_dma_hw_free(struct snd_pcm_substream *substream) nuc900_dma_hw_free() argument
141 snd_pcm_lib_free_pages(substream); nuc900_dma_hw_free()
145 static int nuc900_dma_prepare(struct snd_pcm_substream *substream) nuc900_dma_prepare() argument
147 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_prepare()
154 nuc900_update_dma_register(substream); nuc900_dma_prepare()
160 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { nuc900_dma_prepare()
170 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) nuc900_dma_prepare()
183 static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) nuc900_dma_trigger() argument
190 nuc900_dma_start(substream); nuc900_dma_trigger()
195 nuc900_dma_stop(substream); nuc900_dma_trigger()
206 static int nuc900_dma_getposition(struct snd_pcm_substream *substream, nuc900_dma_getposition() argument
209 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_getposition()
221 static snd_pcm_uframes_t nuc900_dma_pointer(struct snd_pcm_substream *substream) nuc900_dma_pointer() argument
223 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_pointer()
227 nuc900_dma_getposition(substream, &src, &dst); nuc900_dma_pointer()
229 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) nuc900_dma_pointer()
234 return bytes_to_frames(substream->runtime, res); nuc900_dma_pointer()
237 static int nuc900_dma_open(struct snd_pcm_substream *substream) nuc900_dma_open() argument
239 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_open()
242 snd_soc_set_runtime_hwparams(substream, &nuc900_pcm_hardware); nuc900_dma_open()
247 0, "nuc900-dma", substream)) nuc900_dma_open()
255 static int nuc900_dma_close(struct snd_pcm_substream *substream) nuc900_dma_close() argument
257 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_close()
260 free_irq(nuc900_audio->irq_num, substream); nuc900_dma_close()
265 static int nuc900_dma_mmap(struct snd_pcm_substream *substream, nuc900_dma_mmap() argument
268 struct snd_pcm_runtime *runtime = substream->runtime; nuc900_dma_mmap()
270 return dma_mmap_writecombine(substream->pcm->card->dev, vma, nuc900_dma_mmap()
/linux-4.1.27/sound/pci/au88x0/
H A Dau88x0_pcm.c138 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) snd_vortex_pcm_open() argument
140 vortex_t *vortex = snd_pcm_substream_chip(substream); snd_vortex_pcm_open()
141 struct snd_pcm_runtime *runtime = substream->runtime; snd_vortex_pcm_open()
158 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { snd_vortex_pcm_open()
160 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) { snd_vortex_pcm_open()
164 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_SPDIF) { snd_vortex_pcm_open()
178 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB snd_vortex_pcm_open()
179 || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S) snd_vortex_pcm_open()
182 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && snd_vortex_pcm_open()
184 VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { snd_vortex_pcm_open()
191 substream->runtime->private_data = NULL; snd_vortex_pcm_open()
196 substream->runtime->private_data = NULL; snd_vortex_pcm_open()
203 static int snd_vortex_pcm_close(struct snd_pcm_substream *substream) snd_vortex_pcm_close() argument
205 //vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_close()
206 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_close()
210 stream->substream = NULL; snd_vortex_pcm_close()
213 substream->runtime->private_data = NULL; snd_vortex_pcm_close()
219 snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream, snd_vortex_pcm_hw_params() argument
222 vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_hw_params()
223 stream_t *stream = (stream_t *) (substream->runtime->private_data); snd_vortex_pcm_hw_params()
228 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_vortex_pcm_hw_params()
239 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { snd_vortex_pcm_hw_params()
240 int dma, type = VORTEX_PCM_TYPE(substream->pcm); snd_vortex_pcm_hw_params()
246 substream->number); snd_vortex_pcm_hw_params()
251 substream->stream, type, snd_vortex_pcm_hw_params()
252 substream->number); snd_vortex_pcm_hw_params()
257 stream = substream->runtime->private_data = &chip->dma_adb[dma]; snd_vortex_pcm_hw_params()
258 stream->substream = substream; snd_vortex_pcm_hw_params()
263 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { snd_vortex_pcm_hw_params()
264 chip->pcm_vol[substream->number].active = 1; snd_vortex_pcm_hw_params()
266 chip->pcm_vol[substream->number].kctl, 1); snd_vortex_pcm_hw_params()
272 vortex_wt_allocroute(chip, substream->number, 0); */ snd_vortex_pcm_hw_params()
273 vortex_wt_allocroute(chip, substream->number, snd_vortex_pcm_hw_params()
275 stream = substream->runtime->private_data = snd_vortex_pcm_hw_params()
276 &chip->dma_wt[substream->number]; snd_vortex_pcm_hw_params()
277 stream->dma = substream->number; snd_vortex_pcm_hw_params()
278 stream->substream = substream; snd_vortex_pcm_hw_params()
279 vortex_wtdma_setbuffers(chip, substream->number, snd_vortex_pcm_hw_params()
289 static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream) snd_vortex_pcm_hw_free() argument
291 vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_hw_free()
292 stream_t *stream = (stream_t *) (substream->runtime->private_data); snd_vortex_pcm_hw_free()
296 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { snd_vortex_pcm_hw_free()
298 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { snd_vortex_pcm_hw_free()
299 chip->pcm_vol[substream->number].active = 0; snd_vortex_pcm_hw_free()
301 chip->pcm_vol[substream->number].kctl, snd_vortex_pcm_hw_free()
307 substream->number); snd_vortex_pcm_hw_free()
316 substream->runtime->private_data = NULL; snd_vortex_pcm_hw_free()
319 return snd_pcm_lib_free_pages(substream); snd_vortex_pcm_hw_free()
323 static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) snd_vortex_pcm_prepare() argument
325 vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_prepare()
326 struct snd_pcm_runtime *runtime = substream->runtime; snd_vortex_pcm_prepare()
327 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_prepare()
331 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_vortex_pcm_prepare()
337 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { snd_vortex_pcm_prepare()
341 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_SPDIF) snd_vortex_pcm_prepare()
356 static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_vortex_pcm_trigger() argument
358 vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_trigger()
359 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_trigger()
368 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { snd_vortex_pcm_trigger()
383 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) snd_vortex_pcm_trigger()
394 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) snd_vortex_pcm_trigger()
403 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) snd_vortex_pcm_trigger()
419 static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substream) snd_vortex_pcm_pointer() argument
421 vortex_t *chip = snd_pcm_substream_chip(substream); snd_vortex_pcm_pointer()
422 stream_t *stream = (stream_t *) substream->runtime->private_data; snd_vortex_pcm_pointer()
427 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) snd_vortex_pcm_pointer()
435 return (bytes_to_frames(substream->runtime, current_ptr)); snd_vortex_pcm_pointer()
/linux-4.1.27/sound/soc/kirkwood/
H A Dkirkwood-dma.c105 static int kirkwood_dma_open(struct snd_pcm_substream *substream) kirkwood_dma_open() argument
108 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_open()
109 struct kirkwood_dma_data *priv = kirkwood_priv(substream); kirkwood_dma_open()
113 snd_soc_set_runtime_hwparams(substream, &kirkwood_dma_snd_hw); kirkwood_dma_open()
129 err = snd_pcm_hw_constraint_step(substream->runtime, 0, kirkwood_dma_open()
149 addr = substream->dma_buffer.addr; kirkwood_dma_open()
150 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { kirkwood_dma_open()
151 priv->substream_play = substream; kirkwood_dma_open()
155 priv->substream_rec = substream; kirkwood_dma_open()
163 static int kirkwood_dma_close(struct snd_pcm_substream *substream) kirkwood_dma_close() argument
165 struct kirkwood_dma_data *priv = kirkwood_priv(substream); kirkwood_dma_close()
170 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) kirkwood_dma_close()
183 static int kirkwood_dma_hw_params(struct snd_pcm_substream *substream, kirkwood_dma_hw_params() argument
186 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_hw_params()
188 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); kirkwood_dma_hw_params()
194 static int kirkwood_dma_hw_free(struct snd_pcm_substream *substream) kirkwood_dma_hw_free() argument
196 snd_pcm_set_runtime_buffer(substream, NULL); kirkwood_dma_hw_free()
200 static int kirkwood_dma_prepare(struct snd_pcm_substream *substream) kirkwood_dma_prepare() argument
202 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_dma_prepare()
203 struct kirkwood_dma_data *priv = kirkwood_priv(substream); kirkwood_dma_prepare()
209 count = snd_pcm_lib_period_bytes(substream); kirkwood_dma_prepare()
211 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { kirkwood_dma_prepare()
226 *substream) kirkwood_dma_pointer()
228 struct kirkwood_dma_data *priv = kirkwood_priv(substream); kirkwood_dma_pointer()
231 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) kirkwood_dma_pointer()
232 count = bytes_to_frames(substream->runtime, kirkwood_dma_pointer()
235 count = bytes_to_frames(substream->runtime, kirkwood_dma_pointer()
254 struct snd_pcm_substream *substream = pcm->streams[stream].substream; kirkwood_dma_preallocate_dma_buffer() local
255 struct snd_dma_buffer *buf = &substream->dma_buffer; kirkwood_dma_preallocate_dma_buffer()
280 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { kirkwood_dma_new()
287 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { kirkwood_dma_new()
299 struct snd_pcm_substream *substream; kirkwood_dma_free_dma_buffers() local
304 substream = pcm->streams[stream].substream; kirkwood_dma_free_dma_buffers()
305 if (!substream) kirkwood_dma_free_dma_buffers()
307 buf = &substream->dma_buffer; kirkwood_dma_free_dma_buffers()
225 kirkwood_dma_pointer(struct snd_pcm_substream *substream) kirkwood_dma_pointer() argument
H A Dkirkwood-i2s.c130 static int kirkwood_i2s_startup(struct snd_pcm_substream *substream, kirkwood_i2s_startup() argument
135 snd_soc_dai_set_dma_data(dai, substream, priv); kirkwood_i2s_startup()
139 static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream, kirkwood_i2s_hw_params() argument
148 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { kirkwood_i2s_hw_params()
204 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { kirkwood_i2s_hw_params()
234 static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, kirkwood_i2s_play_trigger() argument
237 struct snd_pcm_runtime *runtime = substream->runtime; kirkwood_i2s_play_trigger()
322 static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream, kirkwood_i2s_rec_trigger() argument
388 static int kirkwood_i2s_trigger(struct snd_pcm_substream *substream, int cmd, kirkwood_i2s_trigger() argument
391 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) kirkwood_i2s_trigger()
392 return kirkwood_i2s_play_trigger(substream, cmd, dai); kirkwood_i2s_trigger()
394 return kirkwood_i2s_rec_trigger(substream, cmd, dai); kirkwood_i2s_trigger()
/linux-4.1.27/sound/pci/oxygen/
H A Doxygen_pcm.c127 oxygen_substream_channel(struct snd_pcm_substream *substream) oxygen_substream_channel() argument
129 return (unsigned int)(uintptr_t)substream->runtime->private_data; oxygen_substream_channel()
132 static int oxygen_open(struct snd_pcm_substream *substream, oxygen_open() argument
135 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_open()
136 struct snd_pcm_runtime *runtime = substream->runtime; oxygen_open()
183 snd_pcm_set_sync(substream); oxygen_open()
184 chip->streams[channel] = substream; oxygen_open()
201 static int oxygen_rec_a_open(struct snd_pcm_substream *substream) oxygen_rec_a_open() argument
203 return oxygen_open(substream, PCM_A); oxygen_rec_a_open()
206 static int oxygen_rec_b_open(struct snd_pcm_substream *substream) oxygen_rec_b_open() argument
208 return oxygen_open(substream, PCM_B); oxygen_rec_b_open()
211 static int oxygen_rec_c_open(struct snd_pcm_substream *substream) oxygen_rec_c_open() argument
213 return oxygen_open(substream, PCM_C); oxygen_rec_c_open()
216 static int oxygen_spdif_open(struct snd_pcm_substream *substream) oxygen_spdif_open() argument
218 return oxygen_open(substream, PCM_SPDIF); oxygen_spdif_open()
221 static int oxygen_multich_open(struct snd_pcm_substream *substream) oxygen_multich_open() argument
223 return oxygen_open(substream, PCM_MULTICH); oxygen_multich_open()
226 static int oxygen_ac97_open(struct snd_pcm_substream *substream) oxygen_ac97_open() argument
228 return oxygen_open(substream, PCM_AC97); oxygen_ac97_open()
231 static int oxygen_close(struct snd_pcm_substream *substream) oxygen_close() argument
233 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_close()
234 unsigned int channel = oxygen_substream_channel(substream); oxygen_close()
314 static int oxygen_hw_params(struct snd_pcm_substream *substream, oxygen_hw_params() argument
317 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_hw_params()
318 unsigned int channel = oxygen_substream_channel(substream); oxygen_hw_params()
321 err = snd_pcm_lib_malloc_pages(substream, oxygen_hw_params()
327 (u32)substream->runtime->dma_addr); oxygen_hw_params()
362 static int oxygen_rec_a_hw_params(struct snd_pcm_substream *substream, oxygen_rec_a_hw_params() argument
365 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_rec_a_hw_params()
368 err = oxygen_hw_params(substream, hw_params); oxygen_rec_a_hw_params()
393 static int oxygen_rec_b_hw_params(struct snd_pcm_substream *substream, oxygen_rec_b_hw_params() argument
396 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_rec_b_hw_params()
400 err = oxygen_hw_params(substream, hw_params); oxygen_rec_b_hw_params()
431 static int oxygen_rec_c_hw_params(struct snd_pcm_substream *substream, oxygen_rec_c_hw_params() argument
434 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_rec_c_hw_params()
438 err = oxygen_hw_params(substream, hw_params); oxygen_rec_c_hw_params()
468 static int oxygen_spdif_hw_params(struct snd_pcm_substream *substream, oxygen_spdif_hw_params() argument
471 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_spdif_hw_params()
474 err = oxygen_hw_params(substream, hw_params); oxygen_spdif_hw_params()
494 static int oxygen_multich_hw_params(struct snd_pcm_substream *substream, oxygen_multich_hw_params() argument
497 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_multich_hw_params()
500 err = oxygen_hw_params(substream, hw_params); oxygen_multich_hw_params()
530 static int oxygen_hw_free(struct snd_pcm_substream *substream) oxygen_hw_free() argument
532 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_hw_free()
533 unsigned int channel = oxygen_substream_channel(substream); oxygen_hw_free()
544 return snd_pcm_lib_free_pages(substream); oxygen_hw_free()
547 static int oxygen_spdif_hw_free(struct snd_pcm_substream *substream) oxygen_spdif_hw_free() argument
549 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_spdif_hw_free()
555 return oxygen_hw_free(substream); oxygen_spdif_hw_free()
558 static int oxygen_prepare(struct snd_pcm_substream *substream) oxygen_prepare() argument
560 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_prepare()
561 unsigned int channel = oxygen_substream_channel(substream); oxygen_prepare()
568 if (substream->runtime->no_period_wakeup) oxygen_prepare()
577 static int oxygen_trigger(struct snd_pcm_substream *substream, int cmd) oxygen_trigger() argument
579 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_trigger()
598 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
601 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
622 static snd_pcm_uframes_t oxygen_pointer(struct snd_pcm_substream *substream) oxygen_pointer() argument
624 struct oxygen *chip = snd_pcm_substream_chip(substream); oxygen_pointer()
625 struct snd_pcm_runtime *runtime = substream->runtime; oxygen_pointer()
626 unsigned int channel = oxygen_substream_channel(substream); oxygen_pointer()
726 snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream, oxygen_pcm_init()
732 snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, oxygen_pcm_init()
/linux-4.1.27/sound/pci/emu10k1/
H A Demupcm.c44 if (epcm->substream == NULL) snd_emu10k1_pcm_interrupt()
49 epcm->substream->runtime->hw->pointer(emu, epcm->substream), snd_emu10k1_pcm_interrupt()
50 snd_pcm_lib_period_bytes(epcm->substream), snd_emu10k1_pcm_interrupt()
51 snd_pcm_lib_buffer_bytes(epcm->substream)); snd_emu10k1_pcm_interrupt()
53 snd_pcm_period_elapsed(epcm->substream); snd_emu10k1_pcm_interrupt()
92 static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(struct snd_pcm_substream *substream) snd_emu10k1_efx_playback_pointer() argument
94 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_pointer()
95 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_pointer()
289 struct snd_pcm_substream *substream = evoice->epcm->substream; snd_emu10k1_pcm_init_voice() local
290 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_pcm_init_voice()
408 static int snd_emu10k1_playback_hw_params(struct snd_pcm_substream *substream, snd_emu10k1_playback_hw_params() argument
411 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_hw_params()
412 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_hw_params()
418 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_emu10k1_playback_hw_params()
424 epcm->memblk = snd_emu10k1_alloc_pages(emu, substream); snd_emu10k1_playback_hw_params()
436 static int snd_emu10k1_playback_hw_free(struct snd_pcm_substream *substream) snd_emu10k1_playback_hw_free() argument
438 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_hw_free()
439 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_hw_free()
462 snd_pcm_lib_free_pages(substream); snd_emu10k1_playback_hw_free()
466 static int snd_emu10k1_efx_playback_hw_free(struct snd_pcm_substream *substream) snd_emu10k1_efx_playback_hw_free() argument
468 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_hw_free()
469 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_hw_free()
491 snd_pcm_lib_free_pages(substream); snd_emu10k1_efx_playback_hw_free()
495 static int snd_emu10k1_playback_prepare(struct snd_pcm_substream *substream) snd_emu10k1_playback_prepare() argument
497 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_prepare()
498 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_prepare()
503 end_addr = snd_pcm_lib_period_bytes(substream); snd_emu10k1_playback_prepare()
512 end_addr = epcm->start_addr + snd_pcm_lib_buffer_bytes(substream); snd_emu10k1_playback_prepare()
515 &emu->pcm_mixer[substream->number]); snd_emu10k1_playback_prepare()
519 &emu->pcm_mixer[substream->number]); snd_emu10k1_playback_prepare()
523 static int snd_emu10k1_efx_playback_prepare(struct snd_pcm_substream *substream) snd_emu10k1_efx_playback_prepare() argument
525 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_prepare()
526 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_prepare()
533 end_addr = epcm->start_addr + snd_pcm_lib_buffer_bytes(substream); snd_emu10k1_efx_playback_prepare()
579 static int snd_emu10k1_capture_hw_params(struct snd_pcm_substream *substream, snd_emu10k1_capture_hw_params() argument
582 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_emu10k1_capture_hw_params()
585 static int snd_emu10k1_capture_hw_free(struct snd_pcm_substream *substream) snd_emu10k1_capture_hw_free() argument
587 return snd_pcm_lib_free_pages(substream); snd_emu10k1_capture_hw_free()
590 static int snd_emu10k1_capture_prepare(struct snd_pcm_substream *substream) snd_emu10k1_capture_prepare() argument
592 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_prepare()
593 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_prepare()
614 epcm->capture_bufsize = snd_pcm_lib_buffer_bytes(substream); snd_emu10k1_capture_prepare()
644 runtime = evoice->epcm->substream->runtime; snd_emu10k1_playback_invalidate_cache()
676 struct snd_pcm_substream *substream; snd_emu10k1_playback_prepare_voice() local
683 substream = evoice->epcm->substream; snd_emu10k1_playback_prepare_voice()
684 runtime = substream->runtime; snd_emu10k1_playback_prepare_voice()
699 struct snd_pcm_substream *substream; snd_emu10k1_playback_trigger_voice() local
705 substream = evoice->epcm->substream; snd_emu10k1_playback_trigger_voice()
706 runtime = substream->runtime; snd_emu10k1_playback_trigger_voice()
740 struct snd_pcm_substream *substream, snd_emu10k1_playback_mangle_extra()
755 static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, snd_emu10k1_playback_trigger() argument
758 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_trigger()
759 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_trigger()
767 (int)emu, cmd, substream->ops->pointer(substream)) snd_emu10k1_playback_trigger()
778 snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime); snd_emu10k1_playback_trigger()
779 mix = &emu->pcm_mixer[substream->number]; snd_emu10k1_playback_trigger()
804 static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream, snd_emu10k1_capture_trigger() argument
807 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_trigger()
808 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_trigger()
873 static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *substream) snd_emu10k1_playback_pointer() argument
875 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_pointer()
876 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_pointer()
906 static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream, snd_emu10k1_efx_playback_trigger() argument
909 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_trigger()
910 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_trigger()
957 static snd_pcm_uframes_t snd_emu10k1_capture_pointer(struct snd_pcm_substream *substream) snd_emu10k1_capture_pointer() argument
959 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_pointer()
960 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_pointer()
1082 static int snd_emu10k1_efx_playback_close(struct snd_pcm_substream *substream) snd_emu10k1_efx_playback_close() argument
1084 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_close()
1096 static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream) snd_emu10k1_efx_playback_open() argument
1098 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_efx_playback_open()
1101 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_efx_playback_open()
1109 epcm->substream = substream; snd_emu10k1_efx_playback_open()
1111 emu->pcm_playback_efx_substream = substream; snd_emu10k1_efx_playback_open()
1129 static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream) snd_emu10k1_playback_open() argument
1131 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_open()
1134 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_playback_open()
1142 epcm->substream = substream; snd_emu10k1_playback_open()
1163 mix = &emu->pcm_mixer[substream->number]; snd_emu10k1_playback_open()
1171 snd_emu10k1_pcm_mixer_notify(emu, substream->number, 1); snd_emu10k1_playback_open()
1175 static int snd_emu10k1_playback_close(struct snd_pcm_substream *substream) snd_emu10k1_playback_close() argument
1177 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_playback_close()
1178 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[substream->number]; snd_emu10k1_playback_close()
1181 snd_emu10k1_pcm_mixer_notify(emu, substream->number, 0); snd_emu10k1_playback_close()
1185 static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream) snd_emu10k1_capture_open() argument
1187 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_open()
1188 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_open()
1196 epcm->substream = substream; snd_emu10k1_capture_open()
1206 emu->pcm_capture_substream = substream; snd_emu10k1_capture_open()
1212 static int snd_emu10k1_capture_close(struct snd_pcm_substream *substream) snd_emu10k1_capture_close() argument
1214 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_close()
1221 static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream) snd_emu10k1_capture_mic_open() argument
1223 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_mic_open()
1225 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_mic_open()
1232 epcm->substream = substream; snd_emu10k1_capture_mic_open()
1238 substream->runtime->private_data = epcm; snd_emu10k1_capture_mic_open()
1239 substream->runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_capture_mic_open()
1245 emu->pcm_capture_mic_substream = substream; snd_emu10k1_capture_mic_open()
1250 static int snd_emu10k1_capture_mic_close(struct snd_pcm_substream *substream) snd_emu10k1_capture_mic_close() argument
1252 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_mic_close()
1259 static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) snd_emu10k1_capture_efx_open() argument
1261 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_efx_open()
1263 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_capture_efx_open()
1272 epcm->substream = substream; snd_emu10k1_capture_efx_open()
1278 substream->runtime->private_data = epcm; snd_emu10k1_capture_efx_open()
1279 substream->runtime->private_free = snd_emu10k1_pcm_free_substream; snd_emu10k1_capture_efx_open()
1353 emu->pcm_capture_efx_substream = substream; snd_emu10k1_capture_efx_open()
1358 static int snd_emu10k1_capture_efx_close(struct snd_pcm_substream *substream) snd_emu10k1_capture_efx_close() argument
1360 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_capture_efx_close()
1406 struct snd_pcm_substream *substream; snd_emu10k1_pcm() local
1422 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) snd_emu10k1_pcm()
1423 if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0) snd_emu10k1_pcm()
1426 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next) snd_emu10k1_pcm()
1427 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); snd_emu10k1_pcm()
1435 struct snd_pcm_substream *substream; snd_emu10k1_pcm_multi() local
1450 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) snd_emu10k1_pcm_multi()
1451 if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0) snd_emu10k1_pcm_multi()
1572 struct snd_pcm_substream *substream = private_data; snd_emu10k1_fx8010_playback_irq() local
1573 snd_pcm_period_elapsed(substream); snd_emu10k1_fx8010_playback_irq()
1601 static void fx8010_pb_trans_copy(struct snd_pcm_substream *substream, fx8010_pb_trans_copy() argument
1604 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); fx8010_pb_trans_copy()
1605 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; fx8010_pb_trans_copy()
1607 unsigned short *src = (unsigned short *)(substream->runtime->dma_area + rec->sw_data); fx8010_pb_trans_copy()
1630 static int snd_emu10k1_fx8010_playback_transfer(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_transfer() argument
1632 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_transfer()
1633 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_transfer()
1635 snd_pcm_indirect_playback_transfer(substream, &pcm->pcm_rec, fx8010_pb_trans_copy); snd_emu10k1_fx8010_playback_transfer()
1639 static int snd_emu10k1_fx8010_playback_hw_params(struct snd_pcm_substream *substream, snd_emu10k1_fx8010_playback_hw_params() argument
1642 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_emu10k1_fx8010_playback_hw_params()
1645 static int snd_emu10k1_fx8010_playback_hw_free(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_hw_free() argument
1647 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_hw_free()
1648 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_hw_free()
1653 snd_pcm_lib_free_pages(substream); snd_emu10k1_fx8010_playback_hw_free()
1657 static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_prepare() argument
1659 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_prepare()
1660 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_fx8010_playback_prepare()
1661 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_prepare()
1672 pcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_emu10k1_fx8010_playback_prepare()
1686 static int snd_emu10k1_fx8010_playback_trigger(struct snd_pcm_substream *substream, int cmd) snd_emu10k1_fx8010_playback_trigger() argument
1688 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_trigger()
1689 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_trigger()
1710 result = snd_emu10k1_fx8010_register_irq_handler(emu, snd_emu10k1_fx8010_playback_irq, pcm->gpr_running, substream, &pcm->irq); snd_emu10k1_fx8010_playback_trigger()
1713 snd_emu10k1_fx8010_playback_transfer(substream); /* roll the ball */ snd_emu10k1_fx8010_playback_trigger()
1733 static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_pointer() argument
1735 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_pointer()
1736 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_pointer()
1742 return snd_pcm_indirect_playback_pointer(substream, &pcm->pcm_rec, ptr); snd_emu10k1_fx8010_playback_pointer()
1764 static int snd_emu10k1_fx8010_playback_open(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_open() argument
1766 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_open()
1767 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1_fx8010_playback_open()
1768 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_open()
1783 static int snd_emu10k1_fx8010_playback_close(struct snd_pcm_substream *substream) snd_emu10k1_fx8010_playback_close() argument
1785 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_emu10k1_fx8010_playback_close()
1786 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; snd_emu10k1_fx8010_playback_close()
738 snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu, struct snd_emu10k1_pcm *epcm, struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime) snd_emu10k1_playback_mangle_extra() argument
H A Dp16v.c174 static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substream, int channel_id) snd_p16v_pcm_open_playback_channel() argument
176 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_open_playback_channel()
179 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_open_playback_channel()
188 epcm->substream = substream; snd_p16v_pcm_open_playback_channel()
191 substream->pcm->device, channel_id); snd_p16v_pcm_open_playback_channel()
214 runtime->sync.id32[0] = substream->pcm->card->number; snd_p16v_pcm_open_playback_channel()
222 static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream, int channel_id) snd_p16v_pcm_open_capture_channel() argument
224 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_open_capture_channel()
227 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_open_capture_channel()
236 epcm->substream = substream; snd_p16v_pcm_open_capture_channel()
239 substream->pcm->device, channel_id); snd_p16v_pcm_open_capture_channel()
267 static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream) snd_p16v_pcm_close_playback() argument
269 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_close_playback()
270 //struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_close_playback()
272 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0; snd_p16v_pcm_close_playback()
278 static int snd_p16v_pcm_close_capture(struct snd_pcm_substream *substream) snd_p16v_pcm_close_capture() argument
280 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_close_capture()
281 //struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_close_capture()
288 static int snd_p16v_pcm_open_playback_front(struct snd_pcm_substream *substream) snd_p16v_pcm_open_playback_front() argument
290 return snd_p16v_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); snd_p16v_pcm_open_playback_front()
293 static int snd_p16v_pcm_open_capture(struct snd_pcm_substream *substream) snd_p16v_pcm_open_capture() argument
296 return snd_p16v_pcm_open_capture_channel(substream, 0); snd_p16v_pcm_open_capture()
300 static int snd_p16v_pcm_hw_params_playback(struct snd_pcm_substream *substream, snd_p16v_pcm_hw_params_playback() argument
304 result = snd_pcm_lib_malloc_pages(substream, snd_p16v_pcm_hw_params_playback()
310 static int snd_p16v_pcm_hw_params_capture(struct snd_pcm_substream *substream, snd_p16v_pcm_hw_params_capture() argument
314 result = snd_pcm_lib_malloc_pages(substream, snd_p16v_pcm_hw_params_capture()
321 static int snd_p16v_pcm_hw_free_playback(struct snd_pcm_substream *substream) snd_p16v_pcm_hw_free_playback() argument
324 result = snd_pcm_lib_free_pages(substream); snd_p16v_pcm_hw_free_playback()
329 static int snd_p16v_pcm_hw_free_capture(struct snd_pcm_substream *substream) snd_p16v_pcm_hw_free_capture() argument
332 result = snd_pcm_lib_free_pages(substream); snd_p16v_pcm_hw_free_capture()
338 static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream) snd_p16v_pcm_prepare_playback() argument
340 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_prepare_playback()
341 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_prepare_playback()
342 int channel = substream->pcm->device - emu->p16v_device_offset; snd_p16v_pcm_prepare_playback()
400 static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream) snd_p16v_pcm_prepare_capture() argument
402 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_prepare_capture()
403 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_prepare_capture()
404 int channel = substream->pcm->device - emu->p16v_device_offset; snd_p16v_pcm_prepare_capture()
465 static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream, snd_p16v_pcm_trigger_playback() argument
468 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_trigger_playback()
487 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
493 channel = substream->pcm->device-emu->p16v_device_offset; snd_pcm_group_for_each_entry()
498 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
519 static int snd_p16v_pcm_trigger_capture(struct snd_pcm_substream *substream, snd_p16v_pcm_trigger_capture() argument
522 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_trigger_capture()
523 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_trigger_capture()
550 snd_p16v_pcm_pointer_playback(struct snd_pcm_substream *substream) snd_p16v_pcm_pointer_playback() argument
552 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_pointer_playback()
553 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_pointer_playback()
556 int channel = substream->pcm->device - emu->p16v_device_offset; snd_p16v_pcm_pointer_playback()
575 snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream) snd_p16v_pcm_pointer_capture() argument
577 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); snd_p16v_pcm_pointer_capture()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_p16v_pcm_pointer_capture()
643 struct snd_pcm_substream *substream; snd_p16v_pcm() local
664 for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; snd_p16v_pcm()
665 substream; snd_p16v_pcm()
666 substream = substream->next) { snd_p16v_pcm()
667 if ((err = snd_pcm_lib_preallocate_pages(substream, snd_p16v_pcm()
674 "preallocate playback substream: err=%d\n", err); snd_p16v_pcm()
678 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; snd_p16v_pcm()
679 substream; snd_p16v_pcm()
680 substream = substream->next) { snd_p16v_pcm()
681 if ((err = snd_pcm_lib_preallocate_pages(substream, snd_p16v_pcm()
688 "preallocate capture substream: err=%d\n", err); snd_p16v_pcm()
H A Demu10k1x.c208 struct snd_pcm_substream *substream; member in struct:emu10k1x_pcm
369 if (epcm->substream == NULL) snd_emu10k1x_pcm_interrupt()
374 epcm->substream->ops->pointer(epcm->substream), snd_emu10k1x_pcm_interrupt()
375 snd_pcm_lib_period_bytes(epcm->substream), snd_emu10k1x_pcm_interrupt()
376 snd_pcm_lib_buffer_bytes(epcm->substream)); snd_emu10k1x_pcm_interrupt()
378 snd_pcm_period_elapsed(epcm->substream); snd_emu10k1x_pcm_interrupt()
382 static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream) snd_emu10k1x_playback_open() argument
384 struct emu10k1x *chip = snd_pcm_substream_chip(substream); snd_emu10k1x_playback_open()
386 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_playback_open()
399 epcm->substream = substream; snd_emu10k1x_playback_open()
410 static int snd_emu10k1x_playback_close(struct snd_pcm_substream *substream) snd_emu10k1x_playback_close() argument
416 static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream, snd_emu10k1x_pcm_hw_params() argument
419 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_params()
423 epcm->voice = &epcm->emu->voices[substream->pcm->device]; snd_emu10k1x_pcm_hw_params()
428 return snd_pcm_lib_malloc_pages(substream, snd_emu10k1x_pcm_hw_params()
433 static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_hw_free() argument
435 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_free()
449 return snd_pcm_lib_free_pages(substream); snd_emu10k1x_pcm_hw_free()
453 static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_prepare() argument
455 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_prepare()
456 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_prepare()
482 static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream, snd_emu10k1x_pcm_trigger() argument
485 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_trigger()
486 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_trigger()
494 (int)emu, cmd, (int)substream->ops->pointer(substream)); snd_emu10k1x_pcm_trigger()
520 snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_pointer() argument
522 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_pointer()
523 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_pointer()
563 static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_open_capture() argument
565 struct emu10k1x *chip = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_open_capture()
567 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_open_capture()
580 epcm->substream = substream; snd_emu10k1x_pcm_open_capture()
591 static int snd_emu10k1x_pcm_close_capture(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_close_capture() argument
597 static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substream, snd_emu10k1x_pcm_hw_params_capture() argument
600 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_params_capture()
611 return snd_pcm_lib_malloc_pages(substream, snd_emu10k1x_pcm_hw_params_capture()
616 static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_hw_free_capture() argument
618 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_hw_free_capture()
632 return snd_pcm_lib_free_pages(substream); snd_emu10k1x_pcm_hw_free_capture()
636 static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_prepare_capture() argument
638 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_prepare_capture()
639 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_prepare_capture()
650 static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream, snd_emu10k1x_pcm_trigger_capture() argument
653 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_trigger_capture()
654 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_trigger_capture()
680 snd_emu10k1x_pcm_pointer_capture(struct snd_pcm_substream *substream) snd_emu10k1x_pcm_pointer_capture() argument
682 struct emu10k1x *emu = snd_pcm_substream_chip(substream); snd_emu10k1x_pcm_pointer_capture()
683 struct snd_pcm_runtime *runtime = substream->runtime; snd_emu10k1x_pcm_pointer_capture()
1334 static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) snd_emu10k1x_midi_input_open() argument
1337 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_input_open()
1345 midi->substream_input = substream; snd_emu10k1x_midi_input_open()
1361 static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream) snd_emu10k1x_midi_output_open() argument
1364 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_output_open()
1372 midi->substream_output = substream; snd_emu10k1x_midi_output_open()
1388 static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream) snd_emu10k1x_midi_input_close() argument
1391 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_input_close()
1411 static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream) snd_emu10k1x_midi_output_close() argument
1414 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_output_close()
1434 static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_emu10k1x_midi_input_trigger() argument
1437 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_input_trigger()
1448 static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_emu10k1x_midi_output_trigger() argument
1451 struct emu10k1x_midi *midi = substream->rmidi->private_data; snd_emu10k1x_midi_output_trigger()
1467 snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_emu10k1x_midi_output_trigger()
H A Demumpu401.c156 static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream) snd_emu10k1_midi_input_open() argument
159 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_input_open()
167 midi->substream_input = substream; snd_emu10k1_midi_input_open()
183 static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream) snd_emu10k1_midi_output_open() argument
186 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_output_open()
194 midi->substream_output = substream; snd_emu10k1_midi_output_open()
210 static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream) snd_emu10k1_midi_input_close() argument
213 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_input_close()
233 static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream) snd_emu10k1_midi_output_close() argument
236 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_output_close()
256 static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_emu10k1_midi_input_trigger() argument
259 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_input_trigger()
270 static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_emu10k1_midi_output_trigger() argument
273 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; snd_emu10k1_midi_output_trigger()
289 snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_emu10k1_midi_output_trigger()
/linux-4.1.27/sound/usb/caiaq/
H A Dmidi.c29 static int snd_usb_caiaq_midi_input_open(struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_input_open() argument
34 static int snd_usb_caiaq_midi_input_close(struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_input_close() argument
39 static void snd_usb_caiaq_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_usb_caiaq_midi_input_trigger() argument
41 struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; snd_usb_caiaq_midi_input_trigger()
46 cdev->midi_receive_substream = up ? substream : NULL; snd_usb_caiaq_midi_input_trigger()
50 static int snd_usb_caiaq_midi_output_open(struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_output_open() argument
55 static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_output_close() argument
57 struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; snd_usb_caiaq_midi_output_close()
66 struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_send()
73 len = snd_rawmidi_transmit(substream, cdev->midi_out_buf + 3, snd_usb_caiaq_midi_send()
86 "ret=%d, len=%d\n", substream, ret, len); snd_usb_caiaq_midi_send()
91 static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_usb_caiaq_midi_output_trigger() argument
93 struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; snd_usb_caiaq_midi_output_trigger()
96 cdev->midi_out_substream = substream; snd_usb_caiaq_midi_output_trigger()
98 snd_usb_caiaq_midi_send(cdev, substream); snd_usb_caiaq_midi_output_trigger()
65 snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *cdev, struct snd_rawmidi_substream *substream) snd_usb_caiaq_midi_send() argument
/linux-4.1.27/sound/soc/
H A Dsoc-generic-dmaengine-pcm.c40 struct snd_pcm_substream *substream) dmaengine_dma_dev()
42 if (!pcm->chan[substream->stream]) dmaengine_dma_dev()
45 return pcm->chan[substream->stream]->device->dev; dmaengine_dma_dev()
50 * @substream: PCM substream
61 int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, snd_dmaengine_pcm_prepare_slave_config() argument
64 struct snd_soc_pcm_runtime *rtd = substream->private_data; snd_dmaengine_pcm_prepare_slave_config()
68 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); snd_dmaengine_pcm_prepare_slave_config()
70 ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); snd_dmaengine_pcm_prepare_slave_config()
74 snd_dmaengine_pcm_set_config_from_dai_data(substream, dma_data, snd_dmaengine_pcm_prepare_slave_config()
81 static int dmaengine_pcm_hw_params(struct snd_pcm_substream *substream, dmaengine_pcm_hw_params() argument
84 struct snd_soc_pcm_runtime *rtd = substream->private_data; dmaengine_pcm_hw_params()
86 struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); dmaengine_pcm_hw_params()
87 int (*prepare_slave_config)(struct snd_pcm_substream *substream, dmaengine_pcm_hw_params()
101 ret = prepare_slave_config(substream, params, &slave_config); dmaengine_pcm_hw_params()
110 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); dmaengine_pcm_hw_params()
113 static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substream) dmaengine_pcm_set_runtime_hwparams() argument
115 struct snd_soc_pcm_runtime *rtd = substream->private_data; dmaengine_pcm_set_runtime_hwparams()
117 struct device *dma_dev = dmaengine_dma_dev(pcm, substream); dmaengine_pcm_set_runtime_hwparams()
118 struct dma_chan *chan = pcm->chan[substream->stream]; dmaengine_pcm_set_runtime_hwparams()
128 return snd_soc_set_runtime_hwparams(substream, dmaengine_pcm_set_runtime_hwparams()
131 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); dmaengine_pcm_set_runtime_hwparams()
153 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) dmaengine_pcm_set_runtime_hwparams()
186 return snd_soc_set_runtime_hwparams(substream, &hw); dmaengine_pcm_set_runtime_hwparams()
189 static int dmaengine_pcm_open(struct snd_pcm_substream *substream) dmaengine_pcm_open() argument
191 struct snd_soc_pcm_runtime *rtd = substream->private_data; dmaengine_pcm_open()
193 struct dma_chan *chan = pcm->chan[substream->stream]; dmaengine_pcm_open()
196 ret = dmaengine_pcm_set_runtime_hwparams(substream); dmaengine_pcm_open()
200 return snd_dmaengine_pcm_open(substream, chan); dmaengine_pcm_open()
205 struct snd_pcm_substream *substream) dmaengine_pcm_compat_request_channel()
211 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); dmaengine_pcm_compat_request_channel()
217 return pcm->config->compat_request_channel(rtd, substream); dmaengine_pcm_compat_request_channel()
246 struct snd_pcm_substream *substream; dmaengine_pcm_new() local
262 substream = rtd->pcm->streams[i].substream; dmaengine_pcm_new()
263 if (!substream) dmaengine_pcm_new()
266 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); dmaengine_pcm_new()
275 substream); dmaengine_pcm_new()
284 ret = snd_pcm_lib_preallocate_pages(substream, dmaengine_pcm_new()
286 dmaengine_dma_dev(pcm, substream), dmaengine_pcm_new()
307 struct snd_pcm_substream *substream) dmaengine_pcm_pointer()
309 struct snd_soc_pcm_runtime *rtd = substream->private_data; dmaengine_pcm_pointer()
313 return snd_dmaengine_pcm_pointer_no_residue(substream); dmaengine_pcm_pointer()
315 return snd_dmaengine_pcm_pointer(substream); dmaengine_pcm_pointer()
39 dmaengine_dma_dev(struct dmaengine_pcm *pcm, struct snd_pcm_substream *substream) dmaengine_dma_dev() argument
203 dmaengine_pcm_compat_request_channel( struct snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream) dmaengine_pcm_compat_request_channel() argument
306 dmaengine_pcm_pointer( struct snd_pcm_substream *substream) dmaengine_pcm_pointer() argument
H A Dsoc-pcm.c132 * @substream: the pcm substream
135 * Sets the substream runtime hardware parameters.
137 int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, snd_soc_set_runtime_hwparams() argument
140 struct snd_pcm_runtime *runtime = substream->runtime; snd_soc_set_runtime_hwparams()
174 static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream, soc_pcm_apply_symmetry() argument
177 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_apply_symmetry()
185 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
201 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
218 ret = snd_pcm_hw_constraint_minmax(substream->runtime, soc_pcm_apply_symmetry()
233 static int soc_pcm_params_symmetry(struct snd_pcm_substream *substream, soc_pcm_params_symmetry() argument
236 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_params_symmetry()
284 static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream) soc_pcm_has_symmetry() argument
286 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_has_symmetry()
304 static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits) soc_pcm_set_msb() argument
306 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_set_msb()
312 ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 0, bits); soc_pcm_set_msb()
318 static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) soc_pcm_apply_msb() argument
320 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_apply_msb()
326 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { soc_pcm_apply_msb()
348 soc_pcm_set_msb(substream, bits); soc_pcm_apply_msb()
349 soc_pcm_set_msb(substream, cpu_bits); soc_pcm_apply_msb()
352 static void soc_pcm_init_runtime_hw(struct snd_pcm_substream *substream) soc_pcm_init_runtime_hw() argument
354 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_init_runtime_hw()
356 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_init_runtime_hw()
367 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) soc_pcm_init_runtime_hw()
375 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) soc_pcm_init_runtime_hw()
414 * Called by ALSA when a PCM substream is opened, the runtime->hw record is
418 static int soc_pcm_open(struct snd_pcm_substream *substream) soc_pcm_open() argument
420 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_open()
421 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_open()
440 ret = cpu_dai->driver->ops->startup(substream, cpu_dai); soc_pcm_open()
449 ret = platform->driver->ops->open(substream); soc_pcm_open()
460 ret = codec_dai->driver->ops->startup(substream, soc_pcm_open()
470 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) soc_pcm_open()
477 ret = rtd->dai_link->ops->startup(substream); soc_pcm_open()
490 soc_pcm_init_runtime_hw(substream); soc_pcm_open()
495 if (soc_pcm_has_symmetry(substream)) soc_pcm_open()
516 soc_pcm_apply_msb(substream); soc_pcm_open()
520 ret = soc_pcm_apply_symmetry(substream, cpu_dai); soc_pcm_open()
527 ret = soc_pcm_apply_symmetry(substream, soc_pcm_open()
544 snd_soc_runtime_activate(rtd, substream->stream); soc_pcm_open()
551 rtd->dai_link->ops->shutdown(substream); soc_pcm_open()
560 codec_dai->driver->ops->shutdown(substream, codec_dai); soc_pcm_open()
564 platform->driver->ops->close(substream); soc_pcm_open()
568 cpu_dai->driver->ops->shutdown(substream, cpu_dai); soc_pcm_open()
615 * Called by ALSA when a PCM substream is closed. Private data can be
619 static int soc_pcm_close(struct snd_pcm_substream *substream) soc_pcm_close() argument
621 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_close()
629 snd_soc_runtime_deactivate(rtd, substream->stream); soc_pcm_close()
641 snd_soc_dai_digital_mute(cpu_dai, 1, substream->stream); soc_pcm_close()
644 cpu_dai->driver->ops->shutdown(substream, cpu_dai); soc_pcm_close()
649 codec_dai->driver->ops->shutdown(substream, codec_dai); soc_pcm_close()
653 rtd->dai_link->ops->shutdown(substream); soc_pcm_close()
656 platform->driver->ops->close(substream); soc_pcm_close()
658 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { soc_pcm_close()
694 * Called by ALSA when the PCM substream is prepared, can set format, sample
698 static int soc_pcm_prepare(struct snd_pcm_substream *substream) soc_pcm_prepare() argument
700 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_prepare()
709 ret = rtd->dai_link->ops->prepare(substream); soc_pcm_prepare()
718 ret = platform->driver->ops->prepare(substream); soc_pcm_prepare()
729 ret = codec_dai->driver->ops->prepare(substream, soc_pcm_prepare()
741 ret = cpu_dai->driver->ops->prepare(substream, cpu_dai); soc_pcm_prepare()
750 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && soc_pcm_prepare()
756 snd_soc_dapm_stream_event(rtd, substream->stream, soc_pcm_prepare()
761 substream->stream); soc_pcm_prepare()
762 snd_soc_dai_digital_mute(cpu_dai, 0, substream->stream); soc_pcm_prepare()
780 int soc_dai_hw_params(struct snd_pcm_substream *substream, soc_dai_hw_params() argument
787 ret = dai->driver->ops->hw_params(substream, params, dai); soc_dai_hw_params()
803 static int soc_pcm_hw_params(struct snd_pcm_substream *substream, soc_pcm_hw_params() argument
806 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_hw_params()
813 ret = soc_pcm_params_symmetry(substream, params); soc_pcm_hw_params()
818 ret = rtd->dai_link->ops->hw_params(substream, params); soc_pcm_hw_params()
841 ret = soc_dai_hw_params(substream, &codec_params, codec_dai); soc_pcm_hw_params()
851 ret = soc_dai_hw_params(substream, params, cpu_dai); soc_pcm_hw_params()
856 ret = platform->driver->ops->hw_params(substream, params); soc_pcm_hw_params()
876 cpu_dai->driver->ops->hw_free(substream, cpu_dai); soc_pcm_hw_params()
885 codec_dai->driver->ops->hw_free(substream, codec_dai); soc_pcm_hw_params()
890 rtd->dai_link->ops->hw_free(substream); soc_pcm_hw_params()
899 static int soc_pcm_hw_free(struct snd_pcm_substream *substream) soc_pcm_hw_free() argument
901 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_hw_free()
905 bool playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; soc_pcm_hw_free()
931 substream->stream); soc_pcm_hw_free()
936 rtd->dai_link->ops->hw_free(substream); soc_pcm_hw_free()
940 platform->driver->ops->hw_free(substream); soc_pcm_hw_free()
946 codec_dai->driver->ops->hw_free(substream, codec_dai); soc_pcm_hw_free()
950 cpu_dai->driver->ops->hw_free(substream, cpu_dai); soc_pcm_hw_free()
956 static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) soc_pcm_trigger() argument
958 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_trigger()
967 ret = codec_dai->driver->ops->trigger(substream, soc_pcm_trigger()
975 ret = platform->driver->ops->trigger(substream, cmd); soc_pcm_trigger()
981 ret = cpu_dai->driver->ops->trigger(substream, cmd, cpu_dai); soc_pcm_trigger()
987 ret = rtd->dai_link->ops->trigger(substream, cmd); soc_pcm_trigger()
995 static int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream, soc_pcm_bespoke_trigger() argument
998 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_bespoke_trigger()
1008 ret = codec_dai->driver->ops->bespoke_trigger(substream, soc_pcm_bespoke_trigger()
1016 ret = platform->driver->bespoke_trigger(substream, cmd); soc_pcm_bespoke_trigger()
1022 ret = cpu_dai->driver->ops->bespoke_trigger(substream, cmd, cpu_dai); soc_pcm_bespoke_trigger()
1033 static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) soc_pcm_pointer() argument
1035 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_pointer()
1039 struct snd_pcm_runtime *runtime = substream->runtime; soc_pcm_pointer()
1046 offset = platform->driver->ops->pointer(substream); soc_pcm_pointer()
1049 delay += cpu_dai->driver->ops->delay(substream, cpu_dai); soc_pcm_pointer()
1055 codec_dai->driver->ops->delay(substream, soc_pcm_pointer()
1065 delay += platform->driver->delay(substream, rtd->codec_dais[0]); soc_pcm_pointer()
1351 * FE substream.
1501 static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream) dpcm_set_fe_runtime() argument
1503 struct snd_pcm_runtime *runtime = substream->runtime; dpcm_set_fe_runtime()
1504 struct snd_soc_pcm_runtime *rtd = substream->private_data; dpcm_set_fe_runtime()
1508 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) dpcm_set_fe_runtime()
1514 static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd);
1524 struct snd_pcm_substream *substream = dpcm_set_fe_update_state() local
1527 snd_pcm_stream_lock_irq(substream); dpcm_set_fe_update_state()
1529 dpcm_fe_dai_do_trigger(substream, dpcm_set_fe_update_state()
1534 snd_pcm_stream_unlock_irq(substream); dpcm_set_fe_update_state()
1613 static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream) dpcm_fe_dai_shutdown() argument
1615 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_shutdown()
1616 int stream = substream->stream; dpcm_fe_dai_shutdown()
1621 dpcm_be_dai_shutdown(fe, substream->stream); dpcm_fe_dai_shutdown()
1626 soc_pcm_close(substream); dpcm_fe_dai_shutdown()
1679 static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream) dpcm_fe_dai_hw_free() argument
1681 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_hw_free()
1682 int err, stream = substream->stream; dpcm_fe_dai_hw_free()
1690 err = soc_pcm_hw_free(substream); dpcm_fe_dai_hw_free()
1786 static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream, dpcm_fe_dai_hw_params() argument
1789 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_hw_params()
1790 int ret, stream = substream->stream; dpcm_fe_dai_hw_params()
1795 memcpy(&fe->dpcm[substream->stream].hw_params, params, dpcm_fe_dai_hw_params()
1797 ret = dpcm_be_dai_hw_params(fe, substream->stream); dpcm_fe_dai_hw_params()
1808 ret = soc_pcm_hw_params(substream, params); dpcm_fe_dai_hw_params()
1822 struct snd_pcm_substream *substream, int cmd) dpcm_do_trigger()
1829 ret = soc_pcm_trigger(substream, cmd); dpcm_do_trigger()
1930 static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) dpcm_fe_dai_do_trigger() argument
1932 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_do_trigger()
1933 int stream = substream->stream, ret; dpcm_fe_dai_do_trigger()
1945 ret = soc_pcm_trigger(substream, cmd); dpcm_fe_dai_do_trigger()
1951 ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); dpcm_fe_dai_do_trigger()
1956 ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); dpcm_fe_dai_do_trigger()
1965 ret = soc_pcm_trigger(substream, cmd); dpcm_fe_dai_do_trigger()
1973 ret = soc_pcm_bespoke_trigger(substream, cmd); dpcm_fe_dai_do_trigger()
2004 static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd) dpcm_fe_dai_trigger() argument
2006 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_trigger()
2007 int stream = substream->stream; dpcm_fe_dai_trigger()
2018 return dpcm_fe_dai_do_trigger(substream, cmd); dpcm_fe_dai_trigger()
2055 static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream) dpcm_fe_dai_prepare() argument
2057 struct snd_soc_pcm_runtime *fe = substream->private_data; dpcm_fe_dai_prepare()
2058 int stream = substream->stream, ret = 0; dpcm_fe_dai_prepare()
2074 ret = dpcm_be_dai_prepare(fe, substream->stream); dpcm_fe_dai_prepare()
2079 ret = soc_pcm_prepare(substream); dpcm_fe_dai_prepare()
2097 static int soc_pcm_ioctl(struct snd_pcm_substream *substream, soc_pcm_ioctl() argument
2100 struct snd_soc_pcm_runtime *rtd = substream->private_data; soc_pcm_ioctl()
2104 return platform->driver->ops->ioctl(substream, cmd, arg); soc_pcm_ioctl()
2105 return snd_pcm_lib_ioctl(substream, cmd, arg); soc_pcm_ioctl()
2110 struct snd_pcm_substream *substream = dpcm_run_update_shutdown() local
2123 err = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_STOP); dpcm_run_update_shutdown()
2151 struct snd_pcm_substream *substream = dpcm_run_update_startup() local
2200 ret = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_START); dpcm_run_update_startup()
2522 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd; soc_new_pcm()
2524 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd; soc_new_pcm()
2602 /* get the substream for this BE */
2606 return be->pcm->streams[stream].substream; snd_soc_dpcm_get_substream()
2681 int snd_soc_platform_trigger(struct snd_pcm_substream *substream, snd_soc_platform_trigger() argument
2685 return platform->driver->ops->trigger(substream, cmd); snd_soc_platform_trigger()
1821 dpcm_do_trigger(struct snd_soc_dpcm *dpcm, struct snd_pcm_substream *substream, int cmd) dpcm_do_trigger() argument
H A Dsoc-utils.c72 static int dummy_dma_open(struct snd_pcm_substream *substream) dummy_dma_open() argument
74 struct snd_soc_pcm_runtime *rtd = substream->private_data; dummy_dma_open()
78 snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware); dummy_dma_open()
/linux-4.1.27/drivers/media/usb/go7007/
H A Dsnd-go7007.c47 struct snd_pcm_substream *substream; member in struct:go7007_snd
76 struct snd_pcm_runtime *runtime = gosnd->substream->runtime; parse_audio_stream_data()
103 snd_pcm_period_elapsed(gosnd->substream); parse_audio_stream_data()
106 static int go7007_snd_hw_params(struct snd_pcm_substream *substream, go7007_snd_hw_params() argument
109 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_hw_params()
113 if (substream->runtime->dma_bytes > 0) go7007_snd_hw_params()
114 vfree(substream->runtime->dma_area); go7007_snd_hw_params()
115 substream->runtime->dma_bytes = 0; go7007_snd_hw_params()
116 substream->runtime->dma_area = vmalloc(bytes); go7007_snd_hw_params()
117 if (substream->runtime->dma_area == NULL) go7007_snd_hw_params()
119 substream->runtime->dma_bytes = bytes; go7007_snd_hw_params()
124 static int go7007_snd_hw_free(struct snd_pcm_substream *substream) go7007_snd_hw_free() argument
126 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_hw_free()
129 if (substream->runtime->dma_bytes > 0) go7007_snd_hw_free()
130 vfree(substream->runtime->dma_area); go7007_snd_hw_free()
131 substream->runtime->dma_bytes = 0; go7007_snd_hw_free()
135 static int go7007_snd_capture_open(struct snd_pcm_substream *substream) go7007_snd_capture_open() argument
137 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_capture_open()
143 if (gosnd->substream == NULL) { go7007_snd_capture_open()
144 gosnd->substream = substream; go7007_snd_capture_open()
145 substream->runtime->hw = go7007_snd_capture_hw; go7007_snd_capture_open()
153 static int go7007_snd_capture_close(struct snd_pcm_substream *substream) go7007_snd_capture_close() argument
155 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_capture_close()
158 gosnd->substream = NULL; go7007_snd_capture_close()
162 static int go7007_snd_pcm_prepare(struct snd_pcm_substream *substream) go7007_snd_pcm_prepare() argument
167 static int go7007_snd_pcm_trigger(struct snd_pcm_substream *substream, int cmd) go7007_snd_pcm_trigger() argument
169 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_pcm_trigger()
187 static snd_pcm_uframes_t go7007_snd_pcm_pointer(struct snd_pcm_substream *substream) go7007_snd_pcm_pointer() argument
189 struct go7007 *go = snd_pcm_substream_chip(substream); go7007_snd_pcm_pointer()
195 static struct page *go7007_snd_pcm_page(struct snd_pcm_substream *substream, go7007_snd_pcm_page() argument
198 return vmalloc_to_page(substream->runtime->dma_area + offset); go7007_snd_pcm_page()
278 gosnd->substream = NULL; go7007_snd_init()
/linux-4.1.27/sound/soc/intel/baytrail/
H A Dsst-baytrail-pcm.c46 struct snd_pcm_substream *substream; member in struct:sst_byt_pcm_data
68 static int sst_byt_pcm_hw_params(struct snd_pcm_substream *substream, sst_byt_pcm_hw_params() argument
71 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_hw_params()
74 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_hw_params()
78 int ret, playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); sst_byt_pcm_hw_params()
112 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); sst_byt_pcm_hw_params()
115 substream->dma_buffer.addr, sst_byt_pcm_hw_params()
131 static int sst_byt_pcm_hw_free(struct snd_pcm_substream *substream) sst_byt_pcm_hw_free() argument
133 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_hw_free()
136 snd_pcm_lib_free_pages(substream); sst_byt_pcm_hw_free()
141 static int sst_byt_pcm_restore_stream_context(struct snd_pcm_substream *substream) sst_byt_pcm_restore_stream_context() argument
143 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_restore_stream_context()
146 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_restore_stream_context()
170 if (snd_pcm_running(pcm_data->substream)) sst_byt_pcm_work()
171 sst_byt_pcm_restore_stream_context(pcm_data->substream); sst_byt_pcm_work()
174 static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd) sst_byt_pcm_trigger() argument
176 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_trigger()
179 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_trigger()
216 struct snd_pcm_substream *substream = pcm_data->substream; byt_notify_pointer() local
217 struct snd_pcm_runtime *runtime = substream->runtime; byt_notify_pointer()
218 struct snd_soc_pcm_runtime *rtd = substream->private_data; byt_notify_pointer()
225 snd_pcm_lib_buffer_bytes(substream)); byt_notify_pointer()
233 snd_pcm_period_elapsed(substream); byt_notify_pointer()
237 static snd_pcm_uframes_t sst_byt_pcm_pointer(struct snd_pcm_substream *substream) sst_byt_pcm_pointer() argument
239 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_pointer()
240 struct snd_pcm_runtime *runtime = substream->runtime; sst_byt_pcm_pointer()
243 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_pointer()
250 static int sst_byt_pcm_open(struct snd_pcm_substream *substream) sst_byt_pcm_open() argument
252 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_open()
255 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_open()
262 pcm_data->substream = substream; sst_byt_pcm_open()
264 snd_soc_set_runtime_hwparams(substream, &sst_byt_pcm_hardware); sst_byt_pcm_open()
266 pcm_data->stream = sst_byt_stream_new(byt, substream->stream + 1, sst_byt_pcm_open()
278 static int sst_byt_pcm_close(struct snd_pcm_substream *substream) sst_byt_pcm_close() argument
280 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_close()
283 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream]; sst_byt_pcm_close()
303 static int sst_byt_pcm_mmap(struct snd_pcm_substream *substream, sst_byt_pcm_mmap() argument
306 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_byt_pcm_mmap()
309 return snd_pcm_lib_default_mmap(substream, vma); sst_byt_pcm_mmap()
331 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream || sst_byt_pcm_new()
332 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { sst_byt_pcm_new()
/linux-4.1.27/sound/pci/cs5535audio/
H A Dcs5535audio_pcm.c92 static int snd_cs5535audio_playback_open(struct snd_pcm_substream *substream) snd_cs5535audio_playback_open() argument
95 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_playback_open()
96 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs5535audio_playback_open()
101 cs5535au->playback_substream = substream; snd_cs5535audio_playback_open()
110 static int snd_cs5535audio_playback_close(struct snd_pcm_substream *substream) snd_cs5535audio_playback_close() argument
120 struct snd_pcm_substream *substream, cs5535audio_build_dma_packets()
145 addr = (u32) substream->runtime->dma_addr; cs5535audio_build_dma_packets()
164 dma->substream = substream; cs5535audio_build_dma_packets()
238 struct snd_pcm_substream *substream) cs5535audio_clear_dma_packets()
242 dma->substream = NULL; cs5535audio_clear_dma_packets()
245 static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream, snd_cs5535audio_hw_params() argument
248 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_hw_params()
249 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_hw_params()
252 err = snd_pcm_lib_malloc_pages(substream, snd_cs5535audio_hw_params()
256 dma->buf_addr = substream->runtime->dma_addr; snd_cs5535audio_hw_params()
259 err = cs5535audio_build_dma_packets(cs5535au, dma, substream, snd_cs5535audio_hw_params()
268 static int snd_cs5535audio_hw_free(struct snd_pcm_substream *substream) snd_cs5535audio_hw_free() argument
270 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_hw_free()
271 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_hw_free()
274 if (substream == cs5535au->playback_substream) snd_cs5535audio_hw_free()
282 cs5535audio_clear_dma_packets(cs5535au, dma, substream); snd_cs5535audio_hw_free()
283 return snd_pcm_lib_free_pages(substream); snd_cs5535audio_hw_free()
286 static int snd_cs5535audio_playback_prepare(struct snd_pcm_substream *substream) snd_cs5535audio_playback_prepare() argument
288 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_playback_prepare()
290 substream->runtime->rate); snd_cs5535audio_playback_prepare()
293 static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd) snd_cs5535audio_trigger() argument
295 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_trigger()
296 struct cs5535audio_dma *dma = substream->runtime->private_data; snd_cs5535audio_trigger()
329 *substream) snd_cs5535audio_pcm_pointer()
331 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_pcm_pointer()
335 dma = substream->runtime->private_data; snd_cs5535audio_pcm_pointer()
348 return bytes_to_frames(substream->runtime, curdma); snd_cs5535audio_pcm_pointer()
351 static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream) snd_cs5535audio_capture_open() argument
354 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_capture_open()
355 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs5535audio_capture_open()
360 cs5535au->capture_substream = substream; snd_cs5535audio_capture_open()
369 static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream) snd_cs5535audio_capture_close() argument
371 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_capture_close()
376 static int snd_cs5535audio_capture_prepare(struct snd_pcm_substream *substream) snd_cs5535audio_capture_prepare() argument
378 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); snd_cs5535audio_capture_prepare()
380 substream->runtime->rate); snd_cs5535audio_capture_prepare()
118 cs5535audio_build_dma_packets(struct cs5535audio *cs5535au, struct cs5535audio_dma *dma, struct snd_pcm_substream *substream, unsigned int periods, unsigned int period_bytes) cs5535audio_build_dma_packets() argument
236 cs5535audio_clear_dma_packets(struct cs5535audio *cs5535au, struct cs5535audio_dma *dma, struct snd_pcm_substream *substream) cs5535audio_clear_dma_packets() argument
328 snd_cs5535audio_pcm_pointer(struct snd_pcm_substream *substream) snd_cs5535audio_pcm_pointer() argument
H A Dcs5535audio_pm.c69 if (dma && dma->substream) snd_cs5535audio_suspend()
102 if (dma && dma->substream) { snd_cs5535audio_resume()
103 dma->substream->ops->prepare(dma->substream); snd_cs5535audio_resume()
/linux-4.1.27/sound/soc/qcom/
H A Dlpass-platform.c60 static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream) lpass_platform_pcmops_open() argument
62 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_open()
63 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_open()
66 snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware); lpass_platform_pcmops_open()
78 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); lpass_platform_pcmops_open()
83 static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream, lpass_platform_pcmops_hw_params() argument
86 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_hw_params()
169 static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream) lpass_platform_pcmops_hw_free() argument
171 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_hw_free()
185 static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream) lpass_platform_pcmops_prepare() argument
187 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_prepare()
188 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_prepare()
204 (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1); lpass_platform_pcmops_prepare()
213 (snd_pcm_lib_period_bytes(substream) >> 2) - 1); lpass_platform_pcmops_prepare()
232 static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream, lpass_platform_pcmops_trigger() argument
235 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_trigger()
302 struct snd_pcm_substream *substream) lpass_platform_pcmops_pointer()
304 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcmops_pointer()
326 return bytes_to_frames(substream->runtime, curr_addr - base_addr); lpass_platform_pcmops_pointer()
329 static int lpass_platform_pcmops_mmap(struct snd_pcm_substream *substream, lpass_platform_pcmops_mmap() argument
332 struct snd_pcm_runtime *runtime = substream->runtime; lpass_platform_pcmops_mmap()
334 return dma_mmap_coherent(substream->pcm->card->dev, vma, lpass_platform_pcmops_mmap()
352 struct snd_pcm_substream *substream = data; lpass_platform_lpaif_irq() local
353 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_lpaif_irq()
378 snd_pcm_period_elapsed(substream); lpass_platform_lpaif_irq()
392 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); lpass_platform_lpaif_irq()
406 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); lpass_platform_lpaif_irq()
413 static int lpass_platform_alloc_buffer(struct snd_pcm_substream *substream, lpass_platform_alloc_buffer() argument
416 struct snd_dma_buffer *buf = &substream->dma_buffer; lpass_platform_alloc_buffer()
434 static void lpass_platform_free_buffer(struct snd_pcm_substream *substream, lpass_platform_free_buffer() argument
437 struct snd_dma_buffer *buf = &substream->dma_buffer; lpass_platform_free_buffer()
449 struct snd_pcm_substream *substream = lpass_platform_pcm_new() local
450 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; lpass_platform_pcm_new()
458 ret = lpass_platform_alloc_buffer(substream, soc_runtime); lpass_platform_pcm_new()
464 "lpass-irq-lpaif", substream); lpass_platform_pcm_new()
490 lpass_platform_free_buffer(substream, soc_runtime); lpass_platform_pcm_new()
496 struct snd_pcm_substream *substream = lpass_platform_pcm_free() local
497 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; lpass_platform_pcm_free()
498 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; lpass_platform_pcm_free()
500 lpass_platform_free_buffer(substream, soc_runtime); lpass_platform_pcm_free()
301 lpass_platform_pcmops_pointer( struct snd_pcm_substream *substream) lpass_platform_pcmops_pointer() argument
/linux-4.1.27/drivers/media/pci/cx18/
H A Dcx18-alsa-pcm.c76 struct snd_pcm_substream *substream; cx18_alsa_announce_pcm_data() local
86 substream = cxsc->capture_pcm_substream; cx18_alsa_announce_pcm_data()
87 if (substream == NULL) { cx18_alsa_announce_pcm_data()
88 dprintk("substream was NULL\n"); cx18_alsa_announce_pcm_data()
92 runtime = substream->runtime; cx18_alsa_announce_pcm_data()
127 snd_pcm_stream_lock(substream); cx18_alsa_announce_pcm_data()
143 snd_pcm_stream_unlock(substream); cx18_alsa_announce_pcm_data()
146 snd_pcm_period_elapsed(substream); cx18_alsa_announce_pcm_data()
149 static int snd_cx18_pcm_capture_open(struct snd_pcm_substream *substream) snd_cx18_pcm_capture_open() argument
151 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_capture_open()
152 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx18_pcm_capture_open()
184 cxsc->capture_pcm_substream = substream; snd_cx18_pcm_capture_open()
197 static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream) snd_cx18_pcm_capture_close() argument
199 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_capture_close()
218 static int snd_cx18_pcm_ioctl(struct snd_pcm_substream *substream, snd_cx18_pcm_ioctl() argument
221 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_ioctl()
225 ret = snd_pcm_lib_ioctl(substream, cmd, arg); snd_cx18_pcm_ioctl()
252 static int snd_cx18_pcm_hw_params(struct snd_pcm_substream *substream, snd_cx18_pcm_hw_params() argument
257 return snd_pcm_alloc_vmalloc_buffer(substream, snd_cx18_pcm_hw_params()
261 static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream) snd_cx18_pcm_hw_free() argument
263 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_hw_free()
267 if (substream->runtime->dma_area) { snd_cx18_pcm_hw_free()
269 vfree(substream->runtime->dma_area); snd_cx18_pcm_hw_free()
270 substream->runtime->dma_area = NULL; snd_cx18_pcm_hw_free()
277 static int snd_cx18_pcm_prepare(struct snd_pcm_substream *substream) snd_cx18_pcm_prepare() argument
279 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_prepare()
287 static int snd_cx18_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_cx18_pcm_trigger() argument
293 snd_pcm_uframes_t snd_cx18_pcm_pointer(struct snd_pcm_substream *substream) snd_cx18_pcm_pointer() argument
297 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); snd_cx18_pcm_pointer()
337 1, /* 1 capture substream */ snd_cx18_pcm_create()
/linux-4.1.27/drivers/media/pci/ivtv/
H A Divtv-alsa-pcm.c77 struct snd_pcm_substream *substream; ivtv_alsa_announce_pcm_data() local
87 substream = itvsc->capture_pcm_substream; ivtv_alsa_announce_pcm_data()
88 if (substream == NULL) { ivtv_alsa_announce_pcm_data()
89 dprintk("substream was NULL\n"); ivtv_alsa_announce_pcm_data()
93 runtime = substream->runtime; ivtv_alsa_announce_pcm_data()
128 snd_pcm_stream_lock(substream); ivtv_alsa_announce_pcm_data()
144 snd_pcm_stream_unlock(substream); ivtv_alsa_announce_pcm_data()
147 snd_pcm_period_elapsed(substream); ivtv_alsa_announce_pcm_data()
150 static int snd_ivtv_pcm_capture_open(struct snd_pcm_substream *substream) snd_ivtv_pcm_capture_open() argument
152 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_capture_open()
153 struct snd_pcm_runtime *runtime = substream->runtime; snd_ivtv_pcm_capture_open()
191 itvsc->capture_pcm_substream = substream; snd_ivtv_pcm_capture_open()
204 static int snd_ivtv_pcm_capture_close(struct snd_pcm_substream *substream) snd_ivtv_pcm_capture_close() argument
206 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_capture_close()
225 static int snd_ivtv_pcm_ioctl(struct snd_pcm_substream *substream, snd_ivtv_pcm_ioctl() argument
228 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_ioctl()
232 ret = snd_pcm_lib_ioctl(substream, cmd, arg); snd_ivtv_pcm_ioctl()
259 static int snd_ivtv_pcm_hw_params(struct snd_pcm_substream *substream, snd_ivtv_pcm_hw_params() argument
264 return snd_pcm_alloc_vmalloc_buffer(substream, snd_ivtv_pcm_hw_params()
268 static int snd_ivtv_pcm_hw_free(struct snd_pcm_substream *substream) snd_ivtv_pcm_hw_free() argument
270 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_hw_free()
274 if (substream->runtime->dma_area) { snd_ivtv_pcm_hw_free()
276 vfree(substream->runtime->dma_area); snd_ivtv_pcm_hw_free()
277 substream->runtime->dma_area = NULL; snd_ivtv_pcm_hw_free()
284 static int snd_ivtv_pcm_prepare(struct snd_pcm_substream *substream) snd_ivtv_pcm_prepare() argument
286 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_prepare()
294 static int snd_ivtv_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_ivtv_pcm_trigger() argument
300 snd_pcm_uframes_t snd_ivtv_pcm_pointer(struct snd_pcm_substream *substream) snd_ivtv_pcm_pointer() argument
304 struct snd_ivtv_card *itvsc = snd_pcm_substream_chip(substream); snd_ivtv_pcm_pointer()
344 1, /* 1 capture substream */ snd_ivtv_pcm_create()
/linux-4.1.27/drivers/media/usb/tm6000/
H A Dtm6000-alsa.c105 static void dsp_buffer_free(struct snd_pcm_substream *substream) dsp_buffer_free() argument
107 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); dsp_buffer_free()
111 vfree(substream->runtime->dma_area); dsp_buffer_free()
112 substream->runtime->dma_area = NULL; dsp_buffer_free()
113 substream->runtime->dma_bytes = 0; dsp_buffer_free()
116 static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size) dsp_buffer_alloc() argument
118 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); dsp_buffer_alloc()
122 if (substream->runtime->dma_area) { dsp_buffer_alloc()
123 if (substream->runtime->dma_bytes > size) dsp_buffer_alloc()
126 dsp_buffer_free(substream); dsp_buffer_alloc()
129 substream->runtime->dma_area = vmalloc(size); dsp_buffer_alloc()
130 if (!substream->runtime->dma_area) dsp_buffer_alloc()
133 substream->runtime->dma_bytes = size; dsp_buffer_alloc()
171 static int snd_tm6000_pcm_open(struct snd_pcm_substream *substream) snd_tm6000_pcm_open() argument
173 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_pcm_open()
174 struct snd_pcm_runtime *runtime = substream->runtime; snd_tm6000_pcm_open()
182 chip->substream = substream; snd_tm6000_pcm_open()
196 static int snd_tm6000_close(struct snd_pcm_substream *substream) snd_tm6000_close() argument
198 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_close()
212 struct snd_pcm_substream *substream = chip->substream; tm6000_fillbuf() local
221 if (!size || !substream) { tm6000_fillbuf()
222 dprintk(1, "substream was NULL\n"); tm6000_fillbuf()
226 runtime = substream->runtime; tm6000_fillbuf()
259 snd_pcm_stream_lock(substream); tm6000_fillbuf()
271 snd_pcm_stream_unlock(substream); tm6000_fillbuf()
274 snd_pcm_period_elapsed(substream); tm6000_fillbuf()
282 static int snd_tm6000_hw_params(struct snd_pcm_substream *substream, snd_tm6000_hw_params() argument
289 rc = dsp_buffer_alloc(substream, size); snd_tm6000_hw_params()
299 static int snd_tm6000_hw_free(struct snd_pcm_substream *substream) snd_tm6000_hw_free() argument
301 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_hw_free()
309 dsp_buffer_free(substream); snd_tm6000_hw_free()
316 static int snd_tm6000_prepare(struct snd_pcm_substream *substream) snd_tm6000_prepare() argument
318 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_prepare()
345 static int snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int cmd) snd_tm6000_card_trigger() argument
347 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_card_trigger()
373 static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream) snd_tm6000_pointer() argument
375 struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream); snd_tm6000_pointer()
/linux-4.1.27/sound/core/oss/
H A Dpcm_oss.c565 static int snd_pcm_oss_plugin_clear(struct snd_pcm_substream *substream) snd_pcm_oss_plugin_clear() argument
567 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_plugin_clear()
611 static long snd_pcm_oss_bytes(struct snd_pcm_substream *substream, long frames) snd_pcm_oss_bytes() argument
613 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_bytes()
614 long buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_pcm_oss_bytes()
628 static long snd_pcm_alsa_frames(struct snd_pcm_substream *substream, long bytes) snd_pcm_alsa_frames() argument
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_alsa_frames()
631 long buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_pcm_alsa_frames()
707 static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream, snd_pcm_oss_period_size() argument
714 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_period_size()
720 oss_buffer_size = snd_pcm_plug_client_size(substream, snd_pcm_oss_period_size()
723 if (atomic_read(&substream->mmap_count)) { snd_pcm_oss_period_size()
728 if (substream->oss.setup.period_size > 16) snd_pcm_oss_period_size()
729 oss_period_size = substream->oss.setup.period_size; snd_pcm_oss_period_size()
755 min_period_size = snd_pcm_plug_client_size(substream, snd_pcm_oss_period_size()
762 max_period_size = snd_pcm_plug_client_size(substream, snd_pcm_oss_period_size()
771 if (substream->oss.setup.periods > 1) snd_pcm_oss_period_size()
772 oss_periods = substream->oss.setup.periods; snd_pcm_oss_period_size()
797 static int choose_rate(struct snd_pcm_substream *substream, choose_rate() argument
817 ret = snd_pcm_hw_param_set(substream, params, choose_rate()
834 return snd_pcm_hw_param_near(substream, params, SNDRV_PCM_HW_PARAM_RATE, best_rate, NULL); choose_rate()
837 static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream, snd_pcm_oss_change_params() argument
840 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_change_params()
865 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_change_params()
868 direct = substream->oss.setup.direct; snd_pcm_oss_change_params()
874 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_change_params()
881 err = snd_pcm_hw_param_mask(substream, sparams, SNDRV_PCM_HW_PARAM_ACCESS, &mask); snd_pcm_oss_change_params()
883 pcm_dbg(substream->pcm, "No usable accesses\n"); snd_pcm_oss_change_params()
887 choose_rate(substream, sparams, runtime->oss.rate); snd_pcm_oss_change_params()
888 snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL); snd_pcm_oss_change_params()
908 pcm_dbg(substream->pcm, "Cannot find a format!!!\n"); snd_pcm_oss_change_params()
941 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_change_params()
944 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_change_params()
945 if ((err = snd_pcm_plug_format_plugins(substream, snd_pcm_oss_change_params()
948 pcm_dbg(substream->pcm, snd_pcm_oss_change_params()
950 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_change_params()
955 if ((err = snd_pcm_plugin_build_io(substream, sparams, &plugin)) < 0) { snd_pcm_oss_change_params()
956 pcm_dbg(substream->pcm, snd_pcm_oss_change_params()
958 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_change_params()
961 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_pcm_oss_change_params()
967 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_change_params()
974 err = snd_pcm_oss_period_size(substream, params, sparams); snd_pcm_oss_change_params()
978 n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size); snd_pcm_oss_change_params()
979 err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL); snd_pcm_oss_change_params()
983 err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS, snd_pcm_oss_change_params()
988 snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); snd_pcm_oss_change_params()
990 if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams)) < 0) { snd_pcm_oss_change_params()
991 pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err); snd_pcm_oss_change_params()
1001 if (atomic_read(&substream->mmap_count) || snd_pcm_oss_change_params()
1002 substream->stream == SNDRV_PCM_STREAM_CAPTURE) snd_pcm_oss_change_params()
1008 sw_params->avail_min = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? snd_pcm_oss_change_params()
1010 if (atomic_read(&substream->mmap_count) || snd_pcm_oss_change_params()
1011 substream->oss.setup.nosilence) { snd_pcm_oss_change_params()
1023 if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_SW_PARAMS, sw_params)) < 0) { snd_pcm_oss_change_params()
1024 pcm_dbg(substream->pcm, "SW_PARAMS failed: %i\n", err); snd_pcm_oss_change_params()
1029 oss_period_size = snd_pcm_plug_client_size(substream, params_period_size(sparams)); snd_pcm_oss_change_params()
1036 err = snd_pcm_plug_alloc(substream, oss_period_size); snd_pcm_oss_change_params()
1076 runtime->oss.period_frames = snd_pcm_alsa_frames(substream, oss_period_size); snd_pcm_oss_change_params()
1090 struct snd_pcm_substream *asubstream = NULL, *substream; snd_pcm_oss_get_active_substream() local
1093 substream = pcm_oss_file->streams[idx]; snd_pcm_oss_get_active_substream()
1094 if (substream == NULL) snd_pcm_oss_get_active_substream()
1097 asubstream = substream; snd_pcm_oss_get_active_substream()
1098 if (substream->runtime->oss.params) { snd_pcm_oss_get_active_substream()
1099 err = snd_pcm_oss_change_params(substream, false); snd_pcm_oss_get_active_substream()
1111 static int snd_pcm_oss_prepare(struct snd_pcm_substream *substream) snd_pcm_oss_prepare() argument
1114 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_prepare()
1116 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_PREPARE, NULL); snd_pcm_oss_prepare()
1118 pcm_dbg(substream->pcm, snd_pcm_oss_prepare()
1130 static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream) snd_pcm_oss_make_ready() argument
1135 if (substream == NULL) snd_pcm_oss_make_ready()
1137 runtime = substream->runtime; snd_pcm_oss_make_ready()
1139 err = snd_pcm_oss_change_params(substream, false); snd_pcm_oss_make_ready()
1144 err = snd_pcm_oss_prepare(substream); snd_pcm_oss_make_ready()
1151 static int snd_pcm_oss_capture_position_fixup(struct snd_pcm_substream *substream, snd_pcm_sframes_t *delay) snd_pcm_oss_capture_position_fixup() argument
1158 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, delay); snd_pcm_oss_capture_position_fixup()
1161 runtime = substream->runtime; snd_pcm_oss_capture_position_fixup()
1169 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_FORWARD, &frames); snd_pcm_oss_capture_position_fixup()
1176 snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const char *ptr, snd_pcm_uframes_t frames, int in_kernel) snd_pcm_oss_write3() argument
1178 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write3()
1184 pcm_dbg(substream->pcm, snd_pcm_oss_write3()
1189 ret = snd_pcm_oss_prepare(substream); snd_pcm_oss_write3()
1196 ret = snd_pcm_lib_write(substream, (void __force __user *)ptr, frames); snd_pcm_oss_write3()
1199 ret = snd_pcm_lib_write(substream, (void __force __user *)ptr, frames); snd_pcm_oss_write3()
1211 snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream, char *ptr, snd_pcm_uframes_t frames, int in_kernel) snd_pcm_oss_read3() argument
1213 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read3()
1220 pcm_dbg(substream->pcm, snd_pcm_oss_read3()
1225 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL); snd_pcm_oss_read3()
1229 ret = snd_pcm_oss_prepare(substream); snd_pcm_oss_read3()
1233 ret = snd_pcm_oss_capture_position_fixup(substream, &delay); snd_pcm_oss_read3()
1239 ret = snd_pcm_lib_read(substream, (void __force __user *)ptr, frames); snd_pcm_oss_read3()
1242 ret = snd_pcm_lib_read(substream, (void __force __user *)ptr, frames); snd_pcm_oss_read3()
1246 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); snd_pcm_oss_read3()
1258 snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel) snd_pcm_oss_writev3() argument
1260 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_writev3()
1266 pcm_dbg(substream->pcm, snd_pcm_oss_writev3()
1271 ret = snd_pcm_oss_prepare(substream); snd_pcm_oss_writev3()
1278 ret = snd_pcm_lib_writev(substream, (void __user **)bufs, frames); snd_pcm_oss_writev3()
1281 ret = snd_pcm_lib_writev(substream, (void __user **)bufs, frames); snd_pcm_oss_writev3()
1294 snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel) snd_pcm_oss_readv3() argument
1296 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_readv3()
1302 pcm_dbg(substream->pcm, snd_pcm_oss_readv3()
1307 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL); snd_pcm_oss_readv3()
1311 ret = snd_pcm_oss_prepare(substream); snd_pcm_oss_readv3()
1318 ret = snd_pcm_lib_readv(substream, (void __user **)bufs, frames); snd_pcm_oss_readv3()
1321 ret = snd_pcm_lib_readv(substream, (void __user **)bufs, frames); snd_pcm_oss_readv3()
1329 static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const char *buf, size_t bytes, int in_kernel) snd_pcm_oss_write2() argument
1331 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write2()
1343 frames1 = snd_pcm_plug_client_channels_buf(substream, (char *)buf, frames, &channels); snd_pcm_oss_write2()
1346 frames1 = snd_pcm_plug_write_transfer(substream, channels, frames1); snd_pcm_oss_write2()
1354 frames1 = snd_pcm_oss_write3(substream, buf, frames, in_kernel); snd_pcm_oss_write2()
1362 static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const char __user *buf, size_t bytes) snd_pcm_oss_write1() argument
1366 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_write1()
1368 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_write1()
1371 if ((tmp = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_write1()
1389 if (substream->oss.setup.partialfrag || snd_pcm_oss_write1()
1391 tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer + runtime->oss.period_ptr, snd_pcm_oss_write1()
1401 else if ((substream->f_flags & O_NONBLOCK) != 0) { snd_pcm_oss_write1()
1407 tmp = snd_pcm_oss_write2(substream, snd_pcm_oss_write1()
1416 if ((substream->f_flags & O_NONBLOCK) != 0 && snd_pcm_oss_write1()
1429 static ssize_t snd_pcm_oss_read2(struct snd_pcm_substream *substream, char *buf, size_t bytes, int in_kernel) snd_pcm_oss_read2() argument
1431 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read2()
1441 frames1 = snd_pcm_plug_client_channels_buf(substream, buf, frames, &channels); snd_pcm_oss_read2()
1444 frames1 = snd_pcm_plug_read_transfer(substream, channels, frames1); snd_pcm_oss_read2()
1454 frames1 = snd_pcm_oss_read3(substream, buf, frames, in_kernel); snd_pcm_oss_read2()
1462 static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __user *buf, size_t bytes) snd_pcm_oss_read1() argument
1466 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_read1()
1468 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_read1()
1471 if ((tmp = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_read1()
1477 tmp = snd_pcm_oss_read2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1); snd_pcm_oss_read1()
1496 tmp = snd_pcm_oss_read2(substream, (char __force *)buf, snd_pcm_oss_read1()
1516 struct snd_pcm_substream *substream; snd_pcm_oss_reset() local
1521 substream = pcm_oss_file->streams[i]; snd_pcm_oss_reset()
1522 if (!substream) snd_pcm_oss_reset()
1524 runtime = substream->runtime; snd_pcm_oss_reset()
1525 snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); snd_pcm_oss_reset()
1536 struct snd_pcm_substream *substream; snd_pcm_oss_post() local
1539 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_post()
1540 if (substream != NULL) { snd_pcm_oss_post()
1541 if ((err = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_post()
1543 snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_START, NULL); snd_pcm_oss_post()
1550 static int snd_pcm_oss_sync1(struct snd_pcm_substream *substream, size_t size) snd_pcm_oss_sync1() argument
1558 runtime = substream->runtime; snd_pcm_oss_sync1()
1562 pcm_dbg(substream->pcm, "sync1: size = %li\n", size); snd_pcm_oss_sync1()
1565 result = snd_pcm_oss_write2(substream, runtime->oss.buffer, size, 1); snd_pcm_oss_sync1()
1575 snd_pcm_stream_lock_irq(substream); snd_pcm_oss_sync1()
1577 snd_pcm_stream_unlock_irq(substream); snd_pcm_oss_sync1()
1588 pcm_err(substream->pcm, snd_pcm_oss_sync1()
1602 struct snd_pcm_substream *substream; snd_pcm_oss_sync() local
1608 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_sync()
1609 if (substream != NULL) { snd_pcm_oss_sync()
1610 runtime = substream->runtime; snd_pcm_oss_sync()
1611 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_sync()
1613 if ((err = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_sync()
1620 pcm_dbg(substream->pcm, "sync: buffer_used\n"); snd_pcm_oss_sync()
1626 err = snd_pcm_oss_sync1(substream, runtime->oss.period_bytes); snd_pcm_oss_sync()
1633 pcm_dbg(substream->pcm, "sync: period_ptr\n"); snd_pcm_oss_sync()
1639 err = snd_pcm_oss_sync1(substream, size); snd_pcm_oss_sync()
1665 snd_pcm_lib_write(substream, (void __force __user *)runtime->oss.buffer, size1); snd_pcm_oss_sync()
1671 snd_pcm_lib_writev(substream, buffers, size); snd_pcm_oss_sync()
1679 saved_f_flags = substream->f_flags; snd_pcm_oss_sync()
1680 substream->f_flags &= ~O_NONBLOCK; snd_pcm_oss_sync()
1681 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL); snd_pcm_oss_sync()
1682 substream->f_flags = saved_f_flags; snd_pcm_oss_sync()
1688 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; snd_pcm_oss_sync()
1689 if (substream != NULL) { snd_pcm_oss_sync()
1690 if ((err = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_sync()
1692 runtime = substream->runtime; snd_pcm_oss_sync()
1693 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); snd_pcm_oss_sync()
1707 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_set_rate() local
1709 if (substream == NULL) snd_pcm_oss_set_rate()
1711 runtime = substream->runtime; snd_pcm_oss_set_rate()
1726 struct snd_pcm_substream *substream; snd_pcm_oss_get_rate() local
1729 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) snd_pcm_oss_get_rate()
1731 return substream->runtime->oss.rate; snd_pcm_oss_get_rate()
1742 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_set_channels() local
1744 if (substream == NULL) snd_pcm_oss_set_channels()
1746 runtime = substream->runtime; snd_pcm_oss_set_channels()
1757 struct snd_pcm_substream *substream; snd_pcm_oss_get_channels() local
1760 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) snd_pcm_oss_get_channels()
1762 return substream->runtime->oss.channels; snd_pcm_oss_get_channels()
1767 struct snd_pcm_substream *substream; snd_pcm_oss_get_block_size() local
1770 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) snd_pcm_oss_get_block_size()
1772 return substream->runtime->oss.period_bytes; snd_pcm_oss_get_block_size()
1777 struct snd_pcm_substream *substream; snd_pcm_oss_get_formats() local
1785 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) snd_pcm_oss_get_formats()
1787 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_get_formats()
1790 direct = substream->oss.setup.direct; snd_pcm_oss_get_formats()
1803 err = snd_pcm_hw_refine(substream, params); snd_pcm_oss_get_formats()
1829 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_set_format() local
1831 if (substream == NULL) snd_pcm_oss_set_format()
1833 runtime = substream->runtime; snd_pcm_oss_set_format()
1845 struct snd_pcm_substream *substream; snd_pcm_oss_get_format() local
1848 if ((err = snd_pcm_oss_get_active_substream(pcm_oss_file, &substream)) < 0) snd_pcm_oss_get_format()
1850 return substream->runtime->oss.format; snd_pcm_oss_get_format()
1853 static int snd_pcm_oss_set_subdivide1(struct snd_pcm_substream *substream, int subdivide) snd_pcm_oss_set_subdivide1() argument
1857 if (substream == NULL) snd_pcm_oss_set_subdivide1()
1859 runtime = substream->runtime; snd_pcm_oss_set_subdivide1()
1881 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_set_subdivide() local
1882 if (substream == NULL) snd_pcm_oss_set_subdivide()
1884 if ((err = snd_pcm_oss_set_subdivide1(substream, subdivide)) < 0) snd_pcm_oss_set_subdivide()
1890 static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream, unsigned int val) snd_pcm_oss_set_fragment1() argument
1894 if (substream == NULL) snd_pcm_oss_set_fragment1()
1896 runtime = substream->runtime; snd_pcm_oss_set_fragment1()
1914 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_set_fragment() local
1915 if (substream == NULL) snd_pcm_oss_set_fragment()
1917 if ((err = snd_pcm_oss_set_fragment1(substream, val)) < 0) snd_pcm_oss_set_fragment()
1931 static int snd_pcm_oss_get_caps1(struct snd_pcm_substream *substream, int res) snd_pcm_oss_get_caps1() argument
1934 if (substream == NULL) { snd_pcm_oss_get_caps1()
1939 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_oss_get_caps1()
1940 if (substream->pstr->substream_count > 1) snd_pcm_oss_get_caps1()
1947 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_get_caps1()
1961 struct snd_pcm_substream *substream = pcm_oss_file->streams[idx]; snd_pcm_oss_get_caps() local
1962 result = snd_pcm_oss_get_caps1(substream, result); snd_pcm_oss_get_caps()
1968 static void snd_pcm_oss_simulate_fill(struct snd_pcm_substream *substream, snd_pcm_oss_simulate_fill() argument
1971 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_simulate_fill()
1985 pcm_dbg(substream->pcm, "pcm_oss: trigger = 0x%x\n", trigger); snd_pcm_oss_set_trigger()
2063 struct snd_pcm_substream *substream; snd_pcm_oss_get_odelay() local
2068 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_get_odelay()
2069 if (substream == NULL) snd_pcm_oss_get_odelay()
2071 if ((err = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_get_odelay()
2073 runtime = substream->runtime; snd_pcm_oss_get_odelay()
2076 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); snd_pcm_oss_get_odelay()
2081 return snd_pcm_oss_bytes(substream, delay); snd_pcm_oss_get_odelay()
2086 struct snd_pcm_substream *substream; snd_pcm_oss_get_ptr() local
2095 substream = pcm_oss_file->streams[stream]; snd_pcm_oss_get_ptr()
2096 if (substream == NULL) snd_pcm_oss_get_ptr()
2098 if ((err = snd_pcm_oss_make_ready(substream)) < 0) snd_pcm_oss_get_ptr()
2100 runtime = substream->runtime; snd_pcm_oss_get_ptr()
2108 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); snd_pcm_oss_get_ptr()
2117 err = snd_pcm_oss_capture_position_fixup(substream, &delay); snd_pcm_oss_get_ptr()
2122 info.ptr = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr % runtime->buffer_size); snd_pcm_oss_get_ptr()
2123 if (atomic_read(&substream->mmap_count)) { snd_pcm_oss_get_ptr()
2131 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_oss_get_ptr()
2132 snd_pcm_oss_simulate_fill(substream, delay); snd_pcm_oss_get_ptr()
2133 info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; snd_pcm_oss_get_ptr()
2135 delay = snd_pcm_oss_bytes(substream, delay); snd_pcm_oss_get_ptr()
2137 if (substream->oss.setup.buggyptr) snd_pcm_oss_get_ptr()
2155 struct snd_pcm_substream *substream; snd_pcm_oss_get_space() local
2164 substream = pcm_oss_file->streams[stream]; snd_pcm_oss_get_space()
2165 if (substream == NULL) snd_pcm_oss_get_space()
2167 runtime = substream->runtime; snd_pcm_oss_get_space()
2170 (err = snd_pcm_oss_change_params(substream, false)) < 0) snd_pcm_oss_get_space()
2185 err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail); snd_pcm_oss_get_space()
2195 err = snd_pcm_oss_capture_position_fixup(substream, &avail); snd_pcm_oss_get_space()
2200 info.bytes = snd_pcm_oss_bytes(substream, avail) + fixup; snd_pcm_oss_get_space()
2205 pcm_dbg(substream->pcm, snd_pcm_oss_get_space()
2251 static void snd_pcm_oss_release_substream(struct snd_pcm_substream *substream) snd_pcm_oss_release_substream() argument
2254 runtime = substream->runtime; snd_pcm_oss_release_substream()
2258 snd_pcm_oss_plugin_clear(substream); snd_pcm_oss_release_substream()
2260 substream->oss.oss = 0; snd_pcm_oss_release_substream()
2263 static void snd_pcm_oss_init_substream(struct snd_pcm_substream *substream, snd_pcm_oss_init_substream() argument
2269 substream->oss.oss = 1; snd_pcm_oss_init_substream()
2270 substream->oss.setup = *setup; snd_pcm_oss_init_substream()
2272 substream->f_flags |= O_NONBLOCK; snd_pcm_oss_init_substream()
2274 substream->f_flags &= ~O_NONBLOCK; snd_pcm_oss_init_substream()
2275 runtime = substream->runtime; snd_pcm_oss_init_substream()
2294 substream->pcm_release = snd_pcm_oss_release_substream; snd_pcm_oss_init_substream()
2303 struct snd_pcm_substream *substream = pcm_oss_file->streams[cidx]; snd_pcm_oss_release_file() local
2304 if (substream) snd_pcm_oss_release_file()
2305 snd_pcm_release_substream(substream); snd_pcm_oss_release_file()
2319 struct snd_pcm_substream *substream; snd_pcm_oss_open_file() local
2338 continue; /* no matching substream */ snd_pcm_oss_open_file()
2346 err = snd_pcm_open_substream(pcm, idx, file, &substream); snd_pcm_oss_open_file()
2352 pcm_oss_file->streams[idx] = substream; snd_pcm_oss_open_file()
2353 substream->file = pcm_oss_file; snd_pcm_oss_open_file()
2354 snd_pcm_oss_init_substream(substream, &setup[idx], minor); snd_pcm_oss_open_file()
2472 struct snd_pcm_substream *substream; snd_pcm_oss_release() local
2476 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_release()
2477 if (substream == NULL) snd_pcm_oss_release()
2478 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; snd_pcm_oss_release()
2479 if (snd_BUG_ON(!substream)) snd_pcm_oss_release()
2481 pcm = substream->pcm; snd_pcm_oss_release()
2506 struct snd_pcm_substream *substream; snd_pcm_oss_ioctl() local
2509 substream = pcm_oss_file->streams[idx]; snd_pcm_oss_ioctl()
2510 if (substream != NULL) snd_pcm_oss_ioctl()
2515 return snd_mixer_oss_ioctl_card(substream->pcm->card, cmd, arg); snd_pcm_oss_ioctl()
2663 struct snd_pcm_substream *substream; snd_pcm_oss_read() local
2666 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; snd_pcm_oss_read()
2667 if (substream == NULL) snd_pcm_oss_read()
2669 substream->f_flags = file->f_flags & O_NONBLOCK; snd_pcm_oss_read()
2671 return snd_pcm_oss_read1(substream, buf, count); snd_pcm_oss_read()
2674 ssize_t res = snd_pcm_oss_read1(substream, buf, count); snd_pcm_oss_read()
2675 pcm_dbg(substream->pcm, snd_pcm_oss_read()
2686 struct snd_pcm_substream *substream; snd_pcm_oss_write() local
2690 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_write()
2691 if (substream == NULL) snd_pcm_oss_write()
2693 substream->f_flags = file->f_flags & O_NONBLOCK; snd_pcm_oss_write()
2694 result = snd_pcm_oss_write1(substream, buf, count); snd_pcm_oss_write()
2696 pcm_dbg(substream->pcm, "pcm_oss: write %li bytes (wrote %li bytes)\n", snd_pcm_oss_write()
2702 static int snd_pcm_oss_playback_ready(struct snd_pcm_substream *substream) snd_pcm_oss_playback_ready() argument
2704 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_playback_ready()
2705 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_playback_ready()
2713 static int snd_pcm_oss_capture_ready(struct snd_pcm_substream *substream) snd_pcm_oss_capture_ready() argument
2715 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_oss_capture_ready()
2716 if (atomic_read(&substream->mmap_count)) snd_pcm_oss_capture_ready()
2770 struct snd_pcm_substream *substream = NULL; snd_pcm_oss_mmap() local
2780 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_mmap()
2781 if (substream) snd_pcm_oss_mmap()
2785 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; snd_pcm_oss_mmap()
2788 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; snd_pcm_oss_mmap()
2796 if (substream == NULL) snd_pcm_oss_mmap()
2798 runtime = substream->runtime; snd_pcm_oss_mmap()
2811 err = snd_pcm_oss_change_params(substream, true); snd_pcm_oss_mmap()
2823 err = snd_pcm_mmap_data(substream, file, area); snd_pcm_oss_mmap()
H A Dpcm_plugin.h124 int snd_pcm_plug_format_plugins(struct snd_pcm_substream *substream,
159 snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream,
162 snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream,
164 snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream,
167 snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream,
/linux-4.1.27/sound/usb/line6/
H A Dmidi.c21 #define line6_rawmidi_substream_midi(substream) \
22 ((struct snd_line6_midi *)((substream)->rmidi->private_data))
41 static void line6_midi_transmit(struct snd_rawmidi_substream *substream) line6_midi_transmit() argument
44 line6_rawmidi_substream_midi(substream)->line6; line6_midi_transmit()
52 done = snd_rawmidi_transmit_peek(substream, chunk, req); line6_midi_transmit()
58 snd_rawmidi_transmit_ack(substream, done); line6_midi_transmit()
145 static int line6_midi_output_open(struct snd_rawmidi_substream *substream) line6_midi_output_open() argument
150 static int line6_midi_output_close(struct snd_rawmidi_substream *substream) line6_midi_output_close() argument
155 static void line6_midi_output_trigger(struct snd_rawmidi_substream *substream, line6_midi_output_trigger() argument
160 line6_rawmidi_substream_midi(substream)->line6; line6_midi_output_trigger()
162 line6->line6midi->substream_transmit = substream; line6_midi_output_trigger()
166 line6_midi_transmit(substream); line6_midi_output_trigger()
171 static void line6_midi_output_drain(struct snd_rawmidi_substream *substream) line6_midi_output_drain() argument
174 line6_rawmidi_substream_midi(substream)->line6; line6_midi_output_drain()
181 static int line6_midi_input_open(struct snd_rawmidi_substream *substream) line6_midi_input_open() argument
186 static int line6_midi_input_close(struct snd_rawmidi_substream *substream) line6_midi_input_close() argument
191 static void line6_midi_input_trigger(struct snd_rawmidi_substream *substream, line6_midi_input_trigger() argument
195 line6_rawmidi_substream_midi(substream)->line6; line6_midi_input_trigger()
198 line6->line6midi->substream_receive = substream; line6_midi_input_trigger()
H A Dmidi.h25 /* MIDI substream for receiving (or NULL if not active) */
28 /* MIDI substream for transmitting (or NULL if not active) */
H A Dpcm.h40 Get substream from Line 6 PCM data structure
43 (line6pcm->pcm->streams[stream].substream)
187 extern int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd);
188 extern int snd_line6_prepare(struct snd_pcm_substream *substream);
189 extern int snd_line6_hw_params(struct snd_pcm_substream *substream,
191 extern int snd_line6_hw_free(struct snd_pcm_substream *substream);
192 extern snd_pcm_uframes_t snd_line6_pointer(struct snd_pcm_substream *substream);
H A Dpcm.c224 int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) snd_line6_trigger() argument
226 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_trigger()
232 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
233 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
272 snd_pcm_uframes_t snd_line6_pointer(struct snd_pcm_substream *substream) snd_line6_pointer() argument
274 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_pointer()
275 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); snd_line6_pointer()
328 int snd_line6_hw_params(struct snd_pcm_substream *substream, snd_line6_hw_params() argument
332 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_hw_params()
333 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); snd_line6_hw_params()
340 ret = snd_pcm_lib_malloc_pages(substream, snd_line6_hw_params()
354 int snd_line6_hw_free(struct snd_pcm_substream *substream) snd_line6_hw_free() argument
356 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_hw_free()
357 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); snd_line6_hw_free()
362 return snd_pcm_lib_free_pages(substream); snd_line6_hw_free()
562 int snd_line6_prepare(struct snd_pcm_substream *substream) snd_line6_prepare() argument
564 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_prepare()
565 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); snd_line6_prepare()
H A Dcapture.c90 struct snd_pcm_substream *substream = line6_capture_copy() local
92 struct snd_pcm_runtime *runtime = substream->runtime; line6_capture_copy()
132 struct snd_pcm_substream *substream = line6_capture_check_period() local
139 snd_pcm_period_elapsed(substream); line6_capture_check_period()
211 static int snd_line6_capture_open(struct snd_pcm_substream *substream) snd_line6_capture_open() argument
214 struct snd_pcm_runtime *runtime = substream->runtime; snd_line6_capture_open()
215 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_capture_open()
228 static int snd_line6_capture_close(struct snd_pcm_substream *substream) snd_line6_capture_close() argument
H A Dplayback.c306 struct snd_pcm_substream *substream = audio_out_callback() local
329 struct snd_pcm_runtime *runtime = substream->runtime; audio_out_callback()
357 snd_pcm_period_elapsed(substream); audio_out_callback()
366 static int snd_line6_playback_open(struct snd_pcm_substream *substream) snd_line6_playback_open() argument
369 struct snd_pcm_runtime *runtime = substream->runtime; snd_line6_playback_open()
370 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); snd_line6_playback_open()
382 static int snd_line6_playback_close(struct snd_pcm_substream *substream) snd_line6_playback_close() argument
/linux-4.1.27/sound/isa/wavefront/
H A Dwavefront_midi.c93 get_wavefront_midi (struct snd_rawmidi_substream *substream) get_wavefront_midi() argument
99 if (substream == NULL || substream->rmidi == NULL) get_wavefront_midi()
102 card = substream->rmidi->card; get_wavefront_midi()
232 static int snd_wavefront_midi_input_open(struct snd_rawmidi_substream *substream) snd_wavefront_midi_input_open() argument
238 if (snd_BUG_ON(!substream || !substream->rmidi)) snd_wavefront_midi_input_open()
240 if (snd_BUG_ON(!substream->rmidi->private_data)) snd_wavefront_midi_input_open()
243 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_input_open()
245 if ((midi = get_wavefront_midi (substream)) == NULL) snd_wavefront_midi_input_open()
250 midi->substream_input[mpu] = substream; snd_wavefront_midi_input_open()
256 static int snd_wavefront_midi_output_open(struct snd_rawmidi_substream *substream) snd_wavefront_midi_output_open() argument
262 if (snd_BUG_ON(!substream || !substream->rmidi)) snd_wavefront_midi_output_open()
264 if (snd_BUG_ON(!substream->rmidi->private_data)) snd_wavefront_midi_output_open()
267 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_output_open()
269 if ((midi = get_wavefront_midi (substream)) == NULL) snd_wavefront_midi_output_open()
274 midi->substream_output[mpu] = substream; snd_wavefront_midi_output_open()
280 static int snd_wavefront_midi_input_close(struct snd_rawmidi_substream *substream) snd_wavefront_midi_input_close() argument
286 if (snd_BUG_ON(!substream || !substream->rmidi)) snd_wavefront_midi_input_close()
288 if (snd_BUG_ON(!substream->rmidi->private_data)) snd_wavefront_midi_input_close()
291 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_input_close()
293 if ((midi = get_wavefront_midi (substream)) == NULL) snd_wavefront_midi_input_close()
303 static int snd_wavefront_midi_output_close(struct snd_rawmidi_substream *substream) snd_wavefront_midi_output_close() argument
309 if (snd_BUG_ON(!substream || !substream->rmidi)) snd_wavefront_midi_output_close()
311 if (snd_BUG_ON(!substream->rmidi->private_data)) snd_wavefront_midi_output_close()
314 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_output_close()
316 if ((midi = get_wavefront_midi (substream)) == NULL) snd_wavefront_midi_output_close()
325 static void snd_wavefront_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_wavefront_midi_input_trigger() argument
331 if (substream == NULL || substream->rmidi == NULL) snd_wavefront_midi_input_trigger()
334 if (substream->rmidi->private_data == NULL) snd_wavefront_midi_input_trigger()
337 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_input_trigger()
339 if ((midi = get_wavefront_midi (substream)) == NULL) { snd_wavefront_midi_input_trigger()
364 static void snd_wavefront_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_wavefront_midi_output_trigger() argument
370 if (substream == NULL || substream->rmidi == NULL) snd_wavefront_midi_output_trigger()
373 if (substream->rmidi->private_data == NULL) snd_wavefront_midi_output_trigger()
376 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); snd_wavefront_midi_output_trigger()
378 if ((midi = get_wavefront_midi (substream)) == NULL) { snd_wavefront_midi_output_trigger()
388 (unsigned long) substream->rmidi->card->private_data); snd_wavefront_midi_output_trigger()
400 snd_wavefront_midi_output_write((snd_wavefront_card_t *)substream->rmidi->card->private_data); snd_wavefront_midi_output_trigger()
409 static struct snd_rawmidi_substream *substream = NULL; snd_wavefront_midi_interrupt() local
429 substream = midi->substream_input[external_mpu]; snd_wavefront_midi_interrupt()
432 substream = midi->substream_output[internal_mpu]; snd_wavefront_midi_interrupt()
436 substream = midi->substream_input[internal_mpu]; snd_wavefront_midi_interrupt()
440 if (substream == NULL) { snd_wavefront_midi_interrupt()
445 snd_rawmidi_receive(substream, &byte, 1); snd_wavefront_midi_interrupt()
/linux-4.1.27/sound/soc/au1x/
H A Ddbdma2.c48 struct snd_pcm_substream *substream; member in struct:au1xpsc_audio_dmadata
117 snd_pcm_period_elapsed(cd->substream); au1x_pcm_dmatx_cb()
130 snd_pcm_period_elapsed(cd->substream); au1x_pcm_dmarx_cb()
195 static int au1xpsc_pcm_hw_params(struct snd_pcm_substream *substream, au1xpsc_pcm_hw_params() argument
198 struct snd_pcm_runtime *runtime = substream->runtime; au1xpsc_pcm_hw_params()
202 ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); au1xpsc_pcm_hw_params()
206 stype = substream->stream; au1xpsc_pcm_hw_params()
207 pcd = to_dmadata(substream); au1xpsc_pcm_hw_params()
224 pcd->substream = substream; au1xpsc_pcm_hw_params()
237 static int au1xpsc_pcm_hw_free(struct snd_pcm_substream *substream) au1xpsc_pcm_hw_free() argument
239 snd_pcm_lib_free_pages(substream); au1xpsc_pcm_hw_free()
243 static int au1xpsc_pcm_prepare(struct snd_pcm_substream *substream) au1xpsc_pcm_prepare() argument
245 struct au1xpsc_audio_dmadata *pcd = to_dmadata(substream); au1xpsc_pcm_prepare()
249 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { au1xpsc_pcm_prepare()
260 static int au1xpsc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) au1xpsc_pcm_trigger() argument
262 u32 c = to_dmadata(substream)->ddma_chan; au1xpsc_pcm_trigger()
280 au1xpsc_pcm_pointer(struct snd_pcm_substream *substream) au1xpsc_pcm_pointer() argument
282 return bytes_to_frames(substream->runtime, to_dmadata(substream)->pos); au1xpsc_pcm_pointer()
285 static int au1xpsc_pcm_open(struct snd_pcm_substream *substream) au1xpsc_pcm_open() argument
287 struct au1xpsc_audio_dmadata *pcd = to_dmadata(substream); au1xpsc_pcm_open()
288 struct snd_soc_pcm_runtime *rtd = substream->private_data; au1xpsc_pcm_open()
289 int stype = substream->stream, *dmaids; au1xpsc_pcm_open()
291 dmaids = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); au1xpsc_pcm_open()
297 snd_soc_set_runtime_hwparams(substream, &au1xpsc_pcm_hardware); au1xpsc_pcm_open()
301 static int au1xpsc_pcm_close(struct snd_pcm_substream *substream) au1xpsc_pcm_close() argument
303 au1x_pcm_dbdma_free(to_dmadata(substream)); au1xpsc_pcm_close()
H A Ddma.c31 struct snd_pcm_substream *substream; member in struct:audio_stream
64 struct snd_pcm_substream *substream = stream->substream; au1000_setup_dma_link() local
65 struct snd_pcm_runtime *runtime = substream->runtime; au1000_setup_dma_link()
134 struct snd_pcm_substream *substream = stream->substream; au1000_dma_interrupt() local
159 snd_pcm_period_elapsed(substream); au1000_dma_interrupt()
186 static int alchemy_pcm_open(struct snd_pcm_substream *substream) alchemy_pcm_open() argument
188 struct alchemy_pcm_ctx *ctx = ss_to_ctx(substream); alchemy_pcm_open()
189 struct snd_soc_pcm_runtime *rtd = substream->private_data; alchemy_pcm_open()
190 int *dmaids, s = substream->stream; alchemy_pcm_open()
193 dmaids = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); alchemy_pcm_open()
205 ctx->stream[s].substream = substream; alchemy_pcm_open()
207 snd_soc_set_runtime_hwparams(substream, &alchemy_pcm_hardware); alchemy_pcm_open()
212 static int alchemy_pcm_close(struct snd_pcm_substream *substream) alchemy_pcm_close() argument
214 struct alchemy_pcm_ctx *ctx = ss_to_ctx(substream); alchemy_pcm_close()
215 int stype = substream->stream; alchemy_pcm_close()
217 ctx->stream[stype].substream = NULL; alchemy_pcm_close()
223 static int alchemy_pcm_hw_params(struct snd_pcm_substream *substream, alchemy_pcm_hw_params() argument
226 struct audio_stream *stream = ss_to_as(substream); alchemy_pcm_hw_params()
229 err = snd_pcm_lib_malloc_pages(substream, alchemy_pcm_hw_params()
237 snd_pcm_lib_free_pages(substream); alchemy_pcm_hw_params()
242 static int alchemy_pcm_hw_free(struct snd_pcm_substream *substream) alchemy_pcm_hw_free() argument
244 struct audio_stream *stream = ss_to_as(substream); alchemy_pcm_hw_free()
246 return snd_pcm_lib_free_pages(substream); alchemy_pcm_hw_free()
249 static int alchemy_pcm_trigger(struct snd_pcm_substream *substream, int cmd) alchemy_pcm_trigger() argument
251 struct audio_stream *stream = ss_to_as(substream); alchemy_pcm_trigger()
/linux-4.1.27/sound/soc/atmel/
H A Datmel-pcm-pdc.c53 struct snd_pcm_substream *substream = pcm->streams[stream].substream; atmel_pcm_preallocate_dma_buffer() local
54 struct snd_dma_buffer *buf = &substream->dma_buffer; atmel_pcm_preallocate_dma_buffer()
72 static int atmel_pcm_mmap(struct snd_pcm_substream *substream, atmel_pcm_mmap() argument
76 substream->dma_buffer.addr >> PAGE_SHIFT, atmel_pcm_mmap()
90 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { atmel_pcm_new()
98 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { atmel_pcm_new()
111 struct snd_pcm_substream *substream; atmel_pcm_free() local
116 substream = pcm->streams[stream].substream; atmel_pcm_free()
117 if (!substream) atmel_pcm_free()
120 buf = &substream->dma_buffer; atmel_pcm_free()
164 struct snd_pcm_substream *substream) atmel_pcm_dma_irq()
166 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_dma_irq()
174 substream->stream == SNDRV_PCM_STREAM_PLAYBACK atmel_pcm_dma_irq()
205 snd_pcm_period_elapsed(substream); atmel_pcm_dma_irq()
212 static int atmel_pcm_hw_params(struct snd_pcm_substream *substream, atmel_pcm_hw_params() argument
215 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_hw_params()
217 struct snd_soc_pcm_runtime *rtd = substream->private_data; atmel_pcm_hw_params()
222 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); atmel_pcm_hw_params()
225 prtd->params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); atmel_pcm_hw_params()
241 static int atmel_pcm_hw_free(struct snd_pcm_substream *substream) atmel_pcm_hw_free() argument
243 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_hw_free()
255 static int atmel_pcm_prepare(struct snd_pcm_substream *substream) atmel_pcm_prepare() argument
257 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_prepare()
267 static int atmel_pcm_trigger(struct snd_pcm_substream *substream, atmel_pcm_trigger() argument
270 struct snd_pcm_runtime *rtd = substream->runtime; atmel_pcm_trigger()
334 struct snd_pcm_substream *substream) atmel_pcm_pointer()
336 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_pointer()
351 static int atmel_pcm_open(struct snd_pcm_substream *substream) atmel_pcm_open() argument
353 struct snd_pcm_runtime *runtime = substream->runtime; atmel_pcm_open()
357 snd_soc_set_runtime_hwparams(substream, &atmel_pcm_hardware); atmel_pcm_open()
376 static int atmel_pcm_close(struct snd_pcm_substream *substream) atmel_pcm_close() argument
378 struct atmel_runtime_data *prtd = substream->runtime->private_data; atmel_pcm_close()
163 atmel_pcm_dma_irq(u32 ssc_sr, struct snd_pcm_substream *substream) atmel_pcm_dma_irq() argument
333 atmel_pcm_pointer( struct snd_pcm_substream *substream) atmel_pcm_pointer() argument
H A Datmel-pcm-dma.c67 struct snd_pcm_substream *substream) atmel_pcm_dma_irq()
69 struct snd_soc_pcm_runtime *rtd = substream->private_data; atmel_pcm_dma_irq()
72 prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); atmel_pcm_dma_irq()
75 if (snd_pcm_running(substream)) atmel_pcm_dma_irq()
77 substream->stream == SNDRV_PCM_STREAM_PLAYBACK atmel_pcm_dma_irq()
83 snd_pcm_stop_xrun(substream); atmel_pcm_dma_irq()
91 static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, atmel_pcm_configure_dma() argument
94 struct snd_soc_pcm_runtime *rtd = substream->private_data; atmel_pcm_configure_dma()
99 prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); atmel_pcm_configure_dma()
102 ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); atmel_pcm_configure_dma()
66 atmel_pcm_dma_irq(u32 ssc_sr, struct snd_pcm_substream *substream) atmel_pcm_dma_irq() argument
/linux-4.1.27/sound/soc/sh/
H A Ddma-sh7760.c120 static int camelot_pcm_open(struct snd_pcm_substream *substream) camelot_pcm_open() argument
122 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_pcm_open()
124 int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; camelot_pcm_open()
127 snd_soc_set_runtime_hwparams(substream, &camelot_pcm_hardware); camelot_pcm_open()
132 cam->rx_ss = substream; camelot_pcm_open()
141 cam->tx_ss = substream; camelot_pcm_open()
153 static int camelot_pcm_close(struct snd_pcm_substream *substream) camelot_pcm_close() argument
155 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_pcm_close()
157 int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; camelot_pcm_close()
173 static int camelot_hw_params(struct snd_pcm_substream *substream, camelot_hw_params() argument
176 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_hw_params()
178 int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; camelot_hw_params()
181 ret = snd_pcm_lib_malloc_pages(substream, camelot_hw_params()
196 static int camelot_hw_free(struct snd_pcm_substream *substream) camelot_hw_free() argument
198 return snd_pcm_lib_free_pages(substream); camelot_hw_free()
201 static int camelot_prepare(struct snd_pcm_substream *substream) camelot_prepare() argument
203 struct snd_pcm_runtime *runtime = substream->runtime; camelot_prepare()
204 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_prepare()
210 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { camelot_prepare()
249 static int camelot_trigger(struct snd_pcm_substream *substream, int cmd) camelot_trigger() argument
251 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_trigger()
253 int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; camelot_trigger()
275 static snd_pcm_uframes_t camelot_pos(struct snd_pcm_substream *substream) camelot_pos() argument
277 struct snd_pcm_runtime *runtime = substream->runtime; camelot_pos()
278 struct snd_soc_pcm_runtime *rtd = substream->private_data; camelot_pos()
280 int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; camelot_pos()
H A Dsiu_pcm.c111 snd_pcm_period_elapsed(siu_stream->substream); siu_dma_tx_complete()
120 struct snd_pcm_substream *substream = siu_stream->substream; siu_pcm_wr_set() local
121 struct device *dev = substream->pcm->card->dev; siu_pcm_wr_set()
168 struct snd_pcm_substream *substream = siu_stream->substream; siu_pcm_rd_set() local
169 struct device *dev = substream->pcm->card->dev; siu_pcm_rd_set()
216 struct snd_pcm_substream *substream = siu_stream->substream; siu_io_tasklet() local
217 struct device *dev = substream->pcm->card->dev; siu_io_tasklet()
218 struct snd_pcm_runtime *rt = substream->runtime; siu_io_tasklet()
219 struct siu_port *port_info = siu_port_info(substream); siu_io_tasklet()
228 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { siu_io_tasklet()
278 struct device *dev = siu_stream->substream->pcm->card->dev; siu_pcm_stmread_stop()
376 siu_stream->substream = ss; siu_pcm_open()
398 siu_stream->substream = NULL; siu_pcm_close()
417 rt = siu_stream->substream->runtime; siu_pcm_prepare()
H A Dfsi.c210 struct snd_pcm_substream *substream; member in struct:fsi_stream
401 static int fsi_is_play(struct snd_pcm_substream *substream) fsi_is_play() argument
403 return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; fsi_is_play()
406 static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream) fsi_get_dai() argument
408 struct snd_soc_pcm_runtime *rtd = substream->private_data; fsi_get_dai()
423 static struct fsi_priv *fsi_get_priv(struct snd_pcm_substream *substream) fsi_get_priv() argument
425 return fsi_get_priv_frm_dai(fsi_get_dai(substream)); fsi_get_priv()
499 struct snd_pcm_substream *substream) fsi_stream_get()
501 return fsi_is_play(substream) ? &fsi->playback : &fsi->capture; fsi_stream_get()
512 ret = !!(io->substream && io->substream->runtime); fsi_stream_is_working()
525 struct snd_pcm_substream *substream) fsi_stream_init()
527 struct snd_pcm_runtime *runtime = substream->runtime; fsi_stream_init()
532 io->substream = substream; fsi_stream_init()
547 struct snd_soc_dai *dai = fsi_get_dai(io->substream); fsi_stream_quit()
560 io->substream = NULL; fsi_stream_quit()
1042 struct snd_pcm_substream *substream = io->substream; fsi_pointer_update() local
1043 struct snd_pcm_runtime *runtime = substream->runtime; fsi_pointer_update()
1052 snd_pcm_period_elapsed(substream); fsi_pointer_update()
1111 struct snd_pcm_runtime *runtime = io->substream->runtime; fsi_pio_get_area()
1291 struct snd_soc_dai *dai = fsi_get_dai(io->substream); fsi_dma_transfer()
1292 struct snd_pcm_substream *substream = io->substream; fsi_dma_transfer() local
1304 substream->runtime->dma_addr, fsi_dma_transfer()
1305 snd_pcm_lib_buffer_bytes(substream), fsi_dma_transfer()
1306 snd_pcm_lib_period_bytes(substream), fsi_dma_transfer()
1555 static int fsi_dai_startup(struct snd_pcm_substream *substream, fsi_dai_startup() argument
1558 struct fsi_priv *fsi = fsi_get_priv(substream); fsi_dai_startup()
1565 static void fsi_dai_shutdown(struct snd_pcm_substream *substream, fsi_dai_shutdown() argument
1568 struct fsi_priv *fsi = fsi_get_priv(substream); fsi_dai_shutdown()
1573 static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd, fsi_dai_trigger() argument
1576 struct fsi_priv *fsi = fsi_get_priv(substream); fsi_dai_trigger()
1577 struct fsi_stream *io = fsi_stream_get(fsi, substream); fsi_dai_trigger()
1582 fsi_stream_init(fsi, io, substream); fsi_dai_trigger()
1687 static int fsi_dai_hw_params(struct snd_pcm_substream *substream, fsi_dai_hw_params() argument
1691 struct fsi_priv *fsi = fsi_get_priv(substream); fsi_dai_hw_params()
1723 static int fsi_pcm_open(struct snd_pcm_substream *substream) fsi_pcm_open() argument
1725 struct snd_pcm_runtime *runtime = substream->runtime; fsi_pcm_open()
1728 snd_soc_set_runtime_hwparams(substream, &fsi_pcm_hardware); fsi_pcm_open()
1736 static int fsi_hw_params(struct snd_pcm_substream *substream, fsi_hw_params() argument
1739 return snd_pcm_lib_malloc_pages(substream, fsi_hw_params()
1743 static int fsi_hw_free(struct snd_pcm_substream *substream) fsi_hw_free() argument
1745 return snd_pcm_lib_free_pages(substream); fsi_hw_free()
1748 static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream) fsi_pointer() argument
1750 struct fsi_priv *fsi = fsi_get_priv(substream); fsi_pointer()
1751 struct fsi_stream *io = fsi_stream_get(fsi, substream); fsi_pointer()
498 fsi_stream_get(struct fsi_priv *fsi, struct snd_pcm_substream *substream) fsi_stream_get() argument
523 fsi_stream_init(struct fsi_priv *fsi, struct fsi_stream *io, struct snd_pcm_substream *substream) fsi_stream_init() argument
H A Dmigor.c49 static int migor_hw_params(struct snd_pcm_substream *substream, migor_hw_params() argument
52 struct snd_soc_pcm_runtime *rtd = substream->private_data; migor_hw_params()
83 static int migor_hw_free(struct snd_pcm_substream *substream) migor_hw_free() argument
85 struct snd_soc_pcm_runtime *rtd = substream->private_data; migor_hw_free()
/linux-4.1.27/sound/pci/lola/
H A Dlola_pcm.c34 static struct lola_pcm *lola_get_pcm(struct snd_pcm_substream *substream) lola_get_pcm() argument
36 struct lola *chip = snd_pcm_substream_chip(substream); lola_get_pcm()
37 return &chip->pcm[substream->stream]; lola_get_pcm()
40 static struct lola_stream *lola_get_stream(struct snd_pcm_substream *substream) lola_get_stream() argument
42 struct lola_pcm *pcm = lola_get_pcm(substream); lola_get_stream()
43 unsigned int idx = substream->number; lola_get_stream()
129 struct snd_pcm_substream *substream, lola_sync_wait_for_fifo()
139 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
141 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
165 struct snd_pcm_substream *substream) lola_sync_pause()
169 lola_sync_wait_for_fifo(chip, substream, false); snd_pcm_group_for_each_entry()
170 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
172 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
179 lola_sync_wait_for_fifo(chip, substream, true);
186 lola_sync_pause(chip, str->substream); lola_stream_reset()
223 static int lola_pcm_open(struct snd_pcm_substream *substream) lola_pcm_open() argument
225 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_open()
226 struct lola_pcm *pcm = lola_get_pcm(substream); lola_pcm_open()
227 struct lola_stream *str = lola_get_stream(substream); lola_pcm_open()
228 struct snd_pcm_runtime *runtime = substream->runtime; lola_pcm_open()
235 str->substream = substream; lola_pcm_open()
272 static int lola_pcm_close(struct snd_pcm_substream *substream) lola_pcm_close() argument
274 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_close()
275 struct lola_stream *str = lola_get_stream(substream); lola_pcm_close()
278 if (str->substream == substream) { lola_pcm_close()
279 str->substream = NULL; lola_pcm_close()
290 static int lola_pcm_hw_params(struct snd_pcm_substream *substream, lola_pcm_hw_params() argument
293 struct lola_stream *str = lola_get_stream(substream); lola_pcm_hw_params()
298 return snd_pcm_lib_malloc_pages(substream, lola_pcm_hw_params()
302 static int lola_pcm_hw_free(struct snd_pcm_substream *substream) lola_pcm_hw_free() argument
304 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_hw_free()
305 struct lola_pcm *pcm = lola_get_pcm(substream); lola_pcm_hw_free()
306 struct lola_stream *str = lola_get_stream(substream); lola_pcm_hw_free()
312 return snd_pcm_lib_free_pages(substream); lola_pcm_hw_free()
318 static int setup_bdle(struct snd_pcm_substream *substream, setup_bdle() argument
331 addr = snd_pcm_sgbuf_get_addr(substream, ofs); setup_bdle()
336 chunk = snd_pcm_sgbuf_get_chunk_size(substream, ofs, size); setup_bdle()
355 struct snd_pcm_substream *substream, lola_setup_periods()
369 ofs = setup_bdle(substream, str, &bdl, ofs, period_bytes); lola_setup_periods()
381 static unsigned int lola_get_format_verb(struct snd_pcm_substream *substream) lola_get_format_verb() argument
385 switch (substream->runtime->format) { lola_get_format_verb()
401 verb |= substream->runtime->channels; lola_get_format_verb()
465 static int lola_pcm_prepare(struct snd_pcm_substream *substream) lola_pcm_prepare() argument
467 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_prepare()
468 struct lola_pcm *pcm = lola_get_pcm(substream); lola_pcm_prepare()
469 struct lola_stream *str = lola_get_stream(substream); lola_pcm_prepare()
470 struct snd_pcm_runtime *runtime = substream->runtime; lola_pcm_prepare()
487 bufsize = snd_pcm_lib_buffer_bytes(substream); lola_pcm_prepare()
488 period_bytes = snd_pcm_lib_period_bytes(substream); lola_pcm_prepare()
489 format_verb = lola_get_format_verb(substream); lola_pcm_prepare()
495 err = lola_setup_periods(chip, pcm, substream, str); lola_pcm_prepare()
517 static int lola_pcm_trigger(struct snd_pcm_substream *substream, int cmd) lola_pcm_trigger() argument
519 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_trigger()
545 sync_streams = (start && snd_pcm_stream_linked(substream)); lola_pcm_trigger()
548 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
549 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
558 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
564 static snd_pcm_uframes_t lola_pcm_pointer(struct snd_pcm_substream *substream) lola_pcm_pointer() argument
566 struct lola *chip = snd_pcm_substream_chip(substream); lola_pcm_pointer()
567 struct lola_stream *str = lola_get_stream(substream); lola_pcm_pointer()
572 return bytes_to_frames(substream->runtime, pos); lola_pcm_pointer()
582 if (str->substream && str->running) lola_pcm_update()
583 snd_pcm_period_elapsed(str->substream); lola_pcm_update()
128 lola_sync_wait_for_fifo(struct lola *chip, struct snd_pcm_substream *substream, bool ready) lola_sync_wait_for_fifo() argument
164 lola_sync_pause(struct lola *chip, struct snd_pcm_substream *substream) lola_sync_pause() argument
354 lola_setup_periods(struct lola *chip, struct lola_pcm *pcm, struct snd_pcm_substream *substream, struct lola_stream *str) lola_setup_periods() argument
/linux-4.1.27/sound/isa/sb/
H A Dsb8_main.c104 static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream) snd_sb8_playback_prepare() argument
107 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_playback_prepare()
108 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_playback_prepare()
157 size = chip->p_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_sb8_playback_prepare()
158 count = chip->p_period_size = snd_pcm_lib_period_bytes(substream); snd_sb8_playback_prepare()
206 static int snd_sb8_playback_trigger(struct snd_pcm_substream *substream, snd_sb8_playback_trigger() argument
210 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_playback_trigger()
225 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_playback_trigger()
242 static int snd_sb8_hw_params(struct snd_pcm_substream *substream, snd_sb8_hw_params() argument
245 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_sb8_hw_params()
248 static int snd_sb8_hw_free(struct snd_pcm_substream *substream) snd_sb8_hw_free() argument
250 snd_pcm_lib_free_pages(substream); snd_sb8_hw_free()
254 static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream) snd_sb8_capture_prepare() argument
257 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_capture_prepare()
258 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_capture_prepare()
308 size = chip->c_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_sb8_capture_prepare()
309 count = chip->c_period_size = snd_pcm_lib_period_bytes(substream); snd_sb8_capture_prepare()
343 static int snd_sb8_capture_trigger(struct snd_pcm_substream *substream, snd_sb8_capture_trigger() argument
347 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_capture_trigger()
362 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_capture_trigger()
383 struct snd_pcm_substream *substream; snd_sb8dsp_interrupt() local
393 substream = chip->playback_substream; snd_sb8dsp_interrupt()
394 runtime = substream->runtime; snd_sb8dsp_interrupt()
396 snd_sb8_playback_trigger(substream, SNDRV_PCM_TRIGGER_START); snd_sb8dsp_interrupt()
397 snd_pcm_period_elapsed(substream); snd_sb8dsp_interrupt()
404 substream = chip->capture_substream; snd_sb8dsp_interrupt()
405 runtime = substream->runtime; snd_sb8dsp_interrupt()
407 snd_sb8_capture_trigger(substream, SNDRV_PCM_TRIGGER_START); snd_sb8dsp_interrupt()
408 snd_pcm_period_elapsed(substream); snd_sb8dsp_interrupt()
414 static snd_pcm_uframes_t snd_sb8_playback_pointer(struct snd_pcm_substream *substream) snd_sb8_playback_pointer() argument
416 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_playback_pointer()
427 return bytes_to_frames(substream->runtime, ptr); snd_sb8_playback_pointer()
430 static snd_pcm_uframes_t snd_sb8_capture_pointer(struct snd_pcm_substream *substream) snd_sb8_capture_pointer() argument
432 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_capture_pointer()
443 return bytes_to_frames(substream->runtime, ptr); snd_sb8_capture_pointer()
492 static int snd_sb8_open(struct snd_pcm_substream *substream) snd_sb8_open() argument
494 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_open()
495 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb8_open()
505 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_sb8_open()
506 chip->playback_substream = substream; snd_sb8_open()
509 chip->capture_substream = substream; snd_sb8_open()
533 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_sb8_open()
554 static int snd_sb8_close(struct snd_pcm_substream *substream) snd_sb8_close() argument
557 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb8_close()
563 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_sb8_close()
H A Dsb8_midi.c63 static int snd_sb8dsp_midi_input_open(struct snd_rawmidi_substream *substream) snd_sb8dsp_midi_input_open() argument
69 chip = substream->rmidi->private_data; snd_sb8dsp_midi_input_open()
78 chip->midi_substream_input = substream; snd_sb8dsp_midi_input_open()
90 static int snd_sb8dsp_midi_output_open(struct snd_rawmidi_substream *substream) snd_sb8dsp_midi_output_open() argument
96 chip = substream->rmidi->private_data; snd_sb8dsp_midi_output_open()
105 chip->midi_substream_output = substream; snd_sb8dsp_midi_output_open()
117 static int snd_sb8dsp_midi_input_close(struct snd_rawmidi_substream *substream) snd_sb8dsp_midi_input_close() argument
122 chip = substream->rmidi->private_data; snd_sb8dsp_midi_input_close()
135 static int snd_sb8dsp_midi_output_close(struct snd_rawmidi_substream *substream) snd_sb8dsp_midi_output_close() argument
140 chip = substream->rmidi->private_data; snd_sb8dsp_midi_output_close()
153 static void snd_sb8dsp_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_sb8dsp_midi_input_trigger() argument
158 chip = substream->rmidi->private_data; snd_sb8dsp_midi_input_trigger()
176 static void snd_sb8dsp_midi_output_write(struct snd_rawmidi_substream *substream) snd_sb8dsp_midi_output_write() argument
184 chip = substream->rmidi->private_data; snd_sb8dsp_midi_output_write()
187 if (snd_rawmidi_transmit_peek(substream, &byte, 1) != 1) { snd_sb8dsp_midi_output_write()
207 snd_rawmidi_transmit_ack(substream, 1); snd_sb8dsp_midi_output_write()
214 struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *) data; snd_sb8dsp_midi_output_timer() local
215 struct snd_sb * chip = substream->rmidi->private_data; snd_sb8dsp_midi_output_timer()
221 snd_sb8dsp_midi_output_write(substream); snd_sb8dsp_midi_output_timer()
224 static void snd_sb8dsp_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_sb8dsp_midi_output_trigger() argument
229 chip = substream->rmidi->private_data; snd_sb8dsp_midi_output_trigger()
235 (unsigned long) substream); snd_sb8dsp_midi_output_trigger()
247 snd_sb8dsp_midi_output_write(substream); snd_sb8dsp_midi_output_trigger()
H A Dsb16_main.c247 static int snd_sb16_hw_params(struct snd_pcm_substream *substream, snd_sb16_hw_params() argument
250 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_sb16_hw_params()
253 static int snd_sb16_hw_free(struct snd_pcm_substream *substream) snd_sb16_hw_free() argument
255 snd_pcm_lib_free_pages(substream); snd_sb16_hw_free()
259 static int snd_sb16_playback_prepare(struct snd_pcm_substream *substream) snd_sb16_playback_prepare() argument
262 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_playback_prepare()
263 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_playback_prepare()
275 size = chip->p_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_sb16_playback_prepare()
279 count = snd_pcm_lib_period_bytes(substream); snd_sb16_playback_prepare()
301 static int snd_sb16_playback_trigger(struct snd_pcm_substream *substream, snd_sb16_playback_trigger() argument
304 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_playback_trigger()
329 static int snd_sb16_capture_prepare(struct snd_pcm_substream *substream) snd_sb16_capture_prepare() argument
332 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_capture_prepare()
333 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_capture_prepare()
344 size = chip->c_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_sb16_capture_prepare()
348 count = snd_pcm_lib_period_bytes(substream); snd_sb16_capture_prepare()
370 static int snd_sb16_capture_trigger(struct snd_pcm_substream *substream, snd_sb16_capture_trigger() argument
373 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_capture_trigger()
450 static snd_pcm_uframes_t snd_sb16_playback_pointer(struct snd_pcm_substream *substream) snd_sb16_playback_pointer() argument
452 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_playback_pointer()
458 return bytes_to_frames(substream->runtime, ptr); snd_sb16_playback_pointer()
461 static snd_pcm_uframes_t snd_sb16_capture_pointer(struct snd_pcm_substream *substream) snd_sb16_capture_pointer() argument
463 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_capture_pointer()
469 return bytes_to_frames(substream->runtime, ptr); snd_sb16_capture_pointer()
516 static int snd_sb16_playback_open(struct snd_pcm_substream *substream) snd_sb16_playback_open() argument
519 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_playback_open()
520 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_playback_open()
573 chip->playback_substream = substream; snd_sb16_playback_open()
578 static int snd_sb16_playback_close(struct snd_pcm_substream *substream) snd_sb16_playback_close() argument
581 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_playback_close()
591 static int snd_sb16_capture_open(struct snd_pcm_substream *substream) snd_sb16_capture_open() argument
594 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_capture_open()
595 struct snd_pcm_runtime *runtime = substream->runtime; snd_sb16_capture_open()
648 chip->capture_substream = substream; snd_sb16_capture_open()
653 static int snd_sb16_capture_close(struct snd_pcm_substream *substream) snd_sb16_capture_close() argument
656 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_sb16_capture_close()
/linux-4.1.27/sound/soc/intel/atom/
H A Dsst-mfld-platform-pcm.c131 static void sst_fill_alloc_params(struct snd_pcm_substream *substream, sst_fill_alloc_params() argument
137 ssize_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream); sst_fill_alloc_params()
138 u32 buffer_addr = virt_to_phys(substream->dma_buffer.area); sst_fill_alloc_params()
140 channels = substream->runtime->channels; sst_fill_alloc_params()
141 period_size = substream->runtime->period_size; sst_fill_alloc_params()
142 periodbytes = samples_to_bytes(substream->runtime, period_size); sst_fill_alloc_params()
150 static void sst_fill_pcm_params(struct snd_pcm_substream *substream, sst_fill_pcm_params() argument
153 param->uc.pcm_params.num_chan = (u8) substream->runtime->channels; sst_fill_pcm_params()
154 param->uc.pcm_params.pcm_wd_sz = substream->runtime->sample_bits; sst_fill_pcm_params()
155 param->uc.pcm_params.sfreq = substream->runtime->rate; sst_fill_pcm_params()
181 int sst_fill_stream_params(void *substream, sst_fill_stream_params() argument
194 cstream = (struct snd_compr_stream *)substream; sst_fill_stream_params()
196 pstream = (struct snd_pcm_substream *)substream; sst_fill_stream_params()
230 static int sst_platform_alloc_stream(struct snd_pcm_substream *substream, sst_platform_alloc_stream() argument
234 substream->runtime->private_data; sst_platform_alloc_stream()
242 sst_fill_pcm_params(substream, &param); sst_platform_alloc_stream()
243 sst_fill_alloc_params(substream, &alloc_params); sst_platform_alloc_stream()
244 substream->runtime->dma_area = substream->dma_buffer.area; sst_platform_alloc_stream()
250 ret_val = sst_fill_stream_params(substream, ctx, &str_params, false); sst_platform_alloc_stream()
266 struct snd_pcm_substream *substream = arg; sst_period_elapsed() local
270 if (!substream || !substream->runtime) sst_period_elapsed()
272 stream = substream->runtime->private_data; sst_period_elapsed()
278 snd_pcm_period_elapsed(substream); sst_period_elapsed()
281 static int sst_platform_init_stream(struct snd_pcm_substream *substream) sst_platform_init_stream() argument
284 substream->runtime->private_data; sst_platform_init_stream()
285 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_platform_init_stream()
291 stream->stream_info.arg = substream; sst_platform_init_stream()
293 stream->stream_info.sfreq = substream->runtime->rate; sst_platform_init_stream()
311 static int sst_media_open(struct snd_pcm_substream *substream, sst_media_open() argument
315 struct snd_pcm_runtime *runtime = substream->runtime; sst_media_open()
336 stream->stream_info.arg = substream; sst_media_open()
345 snd_pcm_hw_constraint_step(substream->runtime, 0, sst_media_open()
356 static void sst_media_close(struct snd_pcm_substream *substream, sst_media_close() argument
362 stream = substream->runtime->private_data; sst_media_close()
373 struct snd_pcm_substream *substream) get_current_pipe_id()
378 substream->runtime->private_data; get_current_pipe_id()
389 static int sst_media_prepare(struct snd_pcm_substream *substream, sst_media_prepare() argument
395 stream = substream->runtime->private_data; sst_media_prepare()
402 ret_val = sst_platform_alloc_stream(substream, dai); sst_media_prepare()
405 snprintf(substream->pcm->id, sizeof(substream->pcm->id), sst_media_prepare()
408 ret_val = sst_platform_init_stream(substream); sst_media_prepare()
411 substream->runtime->hw.info = SNDRV_PCM_INFO_BLOCK_TRANSFER; sst_media_prepare()
415 static int sst_media_hw_params(struct snd_pcm_substream *substream, sst_media_hw_params() argument
419 snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); sst_media_hw_params()
420 memset(substream->runtime->dma_area, 0, params_buffer_bytes(params)); sst_media_hw_params()
424 static int sst_media_hw_free(struct snd_pcm_substream *substream, sst_media_hw_free() argument
427 return snd_pcm_lib_free_pages(substream); sst_media_hw_free()
430 static int sst_enable_ssp(struct snd_pcm_substream *substream, sst_enable_ssp() argument
444 static void sst_disable_ssp(struct snd_pcm_substream *substream, sst_disable_ssp() argument
559 static int sst_platform_open(struct snd_pcm_substream *substream) sst_platform_open() argument
563 if (substream->pcm->internal) sst_platform_open()
566 runtime = substream->runtime; sst_platform_open()
571 static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, sst_platform_pcm_trigger() argument
577 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_platform_pcm_trigger()
580 if (substream->pcm->internal) sst_platform_pcm_trigger()
582 stream = substream->runtime->private_data; sst_platform_pcm_trigger()
588 stream->stream_info.arg = substream; sst_platform_pcm_trigger()
620 (struct snd_pcm_substream *substream) sst_platform_pcm_pointer()
625 struct snd_soc_pcm_runtime *rtd = substream->private_data; sst_platform_pcm_pointer()
627 stream = substream->runtime->private_data; sst_platform_pcm_pointer()
637 substream->runtime->delay = str_info->pcm_delay; sst_platform_pcm_pointer()
372 get_current_pipe_id(struct snd_soc_dai *dai, struct snd_pcm_substream *substream) get_current_pipe_id() argument
619 sst_platform_pcm_pointer(struct snd_pcm_substream *substream) sst_platform_pcm_pointer() argument
/linux-4.1.27/sound/soc/txx9/
H A Dtxx9aclc.c51 static int txx9aclc_pcm_hw_params(struct snd_pcm_substream *substream, txx9aclc_pcm_hw_params() argument
54 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); txx9aclc_pcm_hw_params()
55 struct snd_pcm_runtime *runtime = substream->runtime; txx9aclc_pcm_hw_params()
59 ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); txx9aclc_pcm_hw_params()
72 substream->stream); txx9aclc_pcm_hw_params()
74 dmadata->substream = substream; txx9aclc_pcm_hw_params()
79 static int txx9aclc_pcm_hw_free(struct snd_pcm_substream *substream) txx9aclc_pcm_hw_free() argument
81 return snd_pcm_lib_free_pages(substream); txx9aclc_pcm_hw_free()
84 static int txx9aclc_pcm_prepare(struct snd_pcm_substream *substream) txx9aclc_pcm_prepare() argument
86 struct snd_pcm_runtime *runtime = substream->runtime; txx9aclc_pcm_prepare()
90 dmadata->buffer_bytes = snd_pcm_lib_buffer_bytes(substream); txx9aclc_pcm_prepare()
91 dmadata->period_bytes = snd_pcm_lib_period_bytes(substream); txx9aclc_pcm_prepare()
132 dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? txx9aclc_dma_submit()
152 struct snd_pcm_substream *substream = dmadata->substream; txx9aclc_dma_tasklet() local
153 u32 ctlbit = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? txx9aclc_dma_tasklet()
201 snd_pcm_period_elapsed(substream); txx9aclc_dma_tasklet()
206 static int txx9aclc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) txx9aclc_pcm_trigger() argument
208 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_trigger()
213 u32 ctlbit = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? txx9aclc_pcm_trigger()
239 txx9aclc_pcm_pointer(struct snd_pcm_substream *substream) txx9aclc_pcm_pointer() argument
241 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_pointer()
243 return bytes_to_frames(substream->runtime, dmadata->pos); txx9aclc_pcm_pointer()
246 static int txx9aclc_pcm_open(struct snd_pcm_substream *substream) txx9aclc_pcm_open() argument
249 struct txx9aclc_dmadata *dmadata = &dev->dmadata[substream->stream]; txx9aclc_pcm_open()
252 ret = snd_soc_set_runtime_hwparams(substream, &txx9aclc_pcm_hardware); txx9aclc_pcm_open()
256 ret = snd_pcm_hw_constraint_integer(substream->runtime, txx9aclc_pcm_open()
260 substream->runtime->private_data = dmadata; txx9aclc_pcm_open()
264 static int txx9aclc_pcm_close(struct snd_pcm_substream *substream) txx9aclc_pcm_close() argument
266 struct txx9aclc_dmadata *dmadata = substream->runtime->private_data; txx9aclc_pcm_close()
/linux-4.1.27/drivers/media/usb/usbtv/
H A Dusbtv-audio.c51 static int snd_usbtv_pcm_open(struct snd_pcm_substream *substream) snd_usbtv_pcm_open() argument
53 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_pcm_open()
54 struct snd_pcm_runtime *runtime = substream->runtime; snd_usbtv_pcm_open()
56 chip->snd_substream = substream; snd_usbtv_pcm_open()
62 static int snd_usbtv_pcm_close(struct snd_pcm_substream *substream) snd_usbtv_pcm_close() argument
64 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_pcm_close()
74 static int snd_usbtv_hw_params(struct snd_pcm_substream *substream, snd_usbtv_hw_params() argument
78 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_hw_params()
80 rv = snd_pcm_lib_malloc_pages(substream, snd_usbtv_hw_params()
92 static int snd_usbtv_hw_free(struct snd_pcm_substream *substream) snd_usbtv_hw_free() argument
94 snd_pcm_lib_free_pages(substream); snd_usbtv_hw_free()
98 static int snd_usbtv_prepare(struct snd_pcm_substream *substream) snd_usbtv_prepare() argument
100 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_prepare()
111 struct snd_pcm_substream *substream = chip->snd_substream; usbtv_audio_urb_received() local
112 struct snd_pcm_runtime *runtime = substream->runtime; usbtv_audio_urb_received()
168 snd_pcm_stream_lock(substream); usbtv_audio_urb_received()
173 snd_pcm_stream_unlock(substream); usbtv_audio_urb_received()
176 snd_pcm_period_elapsed(substream); usbtv_audio_urb_received()
287 static int snd_usbtv_card_trigger(struct snd_pcm_substream *substream, int cmd) snd_usbtv_card_trigger() argument
289 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_card_trigger()
311 static snd_pcm_uframes_t snd_usbtv_pointer(struct snd_pcm_substream *substream) snd_usbtv_pointer() argument
313 struct usbtv *chip = snd_pcm_substream_chip(substream); snd_usbtv_pointer()
/linux-4.1.27/sound/sh/
H A Dsh_dac_audio.c56 struct snd_pcm_substream *substream; member in struct:snd_sh_dac
114 static int snd_sh_dac_pcm_open(struct snd_pcm_substream *substream) snd_sh_dac_pcm_open() argument
116 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_open()
117 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_open()
121 chip->substream = substream; snd_sh_dac_pcm_open()
131 static int snd_sh_dac_pcm_close(struct snd_pcm_substream *substream) snd_sh_dac_pcm_close() argument
133 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_close()
135 chip->substream = NULL; snd_sh_dac_pcm_close()
143 static int snd_sh_dac_pcm_hw_params(struct snd_pcm_substream *substream, snd_sh_dac_pcm_hw_params() argument
146 return snd_pcm_lib_malloc_pages(substream, snd_sh_dac_pcm_hw_params()
150 static int snd_sh_dac_pcm_hw_free(struct snd_pcm_substream *substream) snd_sh_dac_pcm_hw_free() argument
152 return snd_pcm_lib_free_pages(substream); snd_sh_dac_pcm_hw_free()
155 static int snd_sh_dac_pcm_prepare(struct snd_pcm_substream *substream) snd_sh_dac_pcm_prepare() argument
157 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_prepare()
158 struct snd_pcm_runtime *runtime = chip->substream->runtime; snd_sh_dac_pcm_prepare()
166 static int snd_sh_dac_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_sh_dac_pcm_trigger() argument
168 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_trigger()
187 static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream, int channel, snd_sh_dac_pcm_copy() argument
191 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_copy()
192 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_copy()
213 static int snd_sh_dac_pcm_silence(struct snd_pcm_substream *substream, snd_sh_dac_pcm_silence() argument
218 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_silence()
219 struct snd_pcm_runtime *runtime = substream->runtime; snd_sh_dac_pcm_silence()
241 snd_pcm_uframes_t snd_sh_dac_pcm_pointer(struct snd_pcm_substream *substream) snd_sh_dac_pcm_pointer() argument
243 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); snd_sh_dac_pcm_pointer()
317 struct snd_pcm_runtime *runtime = chip->substream->runtime; sh_dac_audio_timer()
327 snd_pcm_period_elapsed(chip->substream); sh_dac_audio_timer()
H A Daica.c235 struct snd_pcm_substream *substream) aica_dma_transfer()
242 dreamcastcard = substream->pcm->private_data; aica_dma_transfer()
245 runtime = substream->runtime; aica_dma_transfer()
281 runtime = dreamcastcard->substream->runtime; run_spu_dma()
288 dreamcastcard->substream); run_spu_dma()
296 dreamcastcard->substream); run_spu_dma()
297 snd_pcm_period_elapsed(dreamcastcard->substream); run_spu_dma()
310 struct snd_pcm_substream *substream; aica_period_elapsed() local
312 substream = (struct snd_pcm_substream *) timer_var; aica_period_elapsed()
313 runtime = substream->runtime; aica_period_elapsed()
314 dreamcastcard = substream->pcm->private_data; aica_period_elapsed()
333 static void spu_begin_dma(struct snd_pcm_substream *substream) spu_begin_dma() argument
337 runtime = substream->runtime; spu_begin_dma()
338 dreamcastcard = substream->pcm->private_data; spu_begin_dma()
347 (unsigned long) substream); spu_begin_dma()
352 *substream) snd_aicapcm_pcm_open()
359 dreamcastcard = substream->pcm->private_data; snd_aicapcm_pcm_open()
371 runtime = substream->runtime; snd_aicapcm_pcm_open()
381 *substream) snd_aicapcm_pcm_close()
383 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; snd_aicapcm_pcm_close()
393 *substream) snd_aicapcm_pcm_hw_free()
396 return snd_pcm_lib_free_pages(substream); snd_aicapcm_pcm_hw_free()
400 *substream, struct snd_pcm_hw_params snd_aicapcm_pcm_hw_params()
405 snd_pcm_lib_malloc_pages(substream, snd_aicapcm_pcm_hw_params()
410 *substream) snd_aicapcm_pcm_prepare()
412 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; snd_aicapcm_pcm_prepare()
413 if ((substream->runtime)->format == SNDRV_PCM_FORMAT_S16_LE) snd_aicapcm_pcm_prepare()
415 dreamcastcard->channel->freq = substream->runtime->rate; snd_aicapcm_pcm_prepare()
416 dreamcastcard->substream = substream; snd_aicapcm_pcm_prepare()
421 *substream, int cmd) snd_aicapcm_pcm_trigger()
425 spu_begin_dma(substream); snd_aicapcm_pcm_trigger()
437 *substream) snd_aicapcm_pcm_pointer()
234 aica_dma_transfer(int channels, int buffer_size, struct snd_pcm_substream *substream) aica_dma_transfer() argument
351 snd_aicapcm_pcm_open(struct snd_pcm_substream *substream) snd_aicapcm_pcm_open() argument
380 snd_aicapcm_pcm_close(struct snd_pcm_substream *substream) snd_aicapcm_pcm_close() argument
392 snd_aicapcm_pcm_hw_free(struct snd_pcm_substream *substream) snd_aicapcm_pcm_hw_free() argument
399 snd_aicapcm_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) snd_aicapcm_pcm_hw_params() argument
409 snd_aicapcm_pcm_prepare(struct snd_pcm_substream *substream) snd_aicapcm_pcm_prepare() argument
420 snd_aicapcm_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_aicapcm_pcm_trigger() argument
436 snd_aicapcm_pcm_pointer(struct snd_pcm_substream *substream) snd_aicapcm_pcm_pointer() argument
/linux-4.1.27/sound/mips/
H A Dhal2.c70 struct snd_pcm_substream *substream; member in struct:hal2_codec
313 snd_pcm_period_elapsed(hal2->dac.substream); hal2_interrupt()
317 snd_pcm_period_elapsed(hal2->adc.substream); hal2_interrupt()
513 static int hal2_pcm_hw_params(struct snd_pcm_substream *substream, hal2_pcm_hw_params() argument
518 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); hal2_pcm_hw_params()
525 static int hal2_pcm_hw_free(struct snd_pcm_substream *substream) hal2_pcm_hw_free() argument
527 return snd_pcm_lib_free_pages(substream); hal2_pcm_hw_free()
530 static int hal2_playback_open(struct snd_pcm_substream *substream) hal2_playback_open() argument
532 struct snd_pcm_runtime *runtime = substream->runtime; hal2_playback_open()
533 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_open()
544 static int hal2_playback_close(struct snd_pcm_substream *substream) hal2_playback_close() argument
546 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_close()
552 static int hal2_playback_prepare(struct snd_pcm_substream *substream) hal2_playback_prepare() argument
554 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_prepare()
555 struct snd_pcm_runtime *runtime = substream->runtime; hal2_playback_prepare()
562 dac->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); hal2_playback_prepare()
563 dac->substream = substream; hal2_playback_prepare()
568 static int hal2_playback_trigger(struct snd_pcm_substream *substream, int cmd) hal2_playback_trigger() argument
570 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_trigger()
576 substream->ops->ack(substream); hal2_playback_trigger()
589 hal2_playback_pointer(struct snd_pcm_substream *substream) hal2_playback_pointer() argument
591 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_pointer()
594 return snd_pcm_indirect_playback_pointer(substream, &dac->pcm_indirect, hal2_playback_pointer()
598 static void hal2_playback_transfer(struct snd_pcm_substream *substream, hal2_playback_transfer() argument
601 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_transfer()
604 memcpy(buf, substream->runtime->dma_area + rec->sw_data, bytes); hal2_playback_transfer()
609 static int hal2_playback_ack(struct snd_pcm_substream *substream) hal2_playback_ack() argument
611 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_playback_ack()
615 snd_pcm_indirect_playback_transfer(substream, hal2_playback_ack()
621 static int hal2_capture_open(struct snd_pcm_substream *substream) hal2_capture_open() argument
623 struct snd_pcm_runtime *runtime = substream->runtime; hal2_capture_open()
624 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_open()
636 static int hal2_capture_close(struct snd_pcm_substream *substream) hal2_capture_close() argument
638 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_close()
644 static int hal2_capture_prepare(struct snd_pcm_substream *substream) hal2_capture_prepare() argument
646 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_prepare()
647 struct snd_pcm_runtime *runtime = substream->runtime; hal2_capture_prepare()
655 adc->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); hal2_capture_prepare()
656 adc->substream = substream; hal2_capture_prepare()
661 static int hal2_capture_trigger(struct snd_pcm_substream *substream, int cmd) hal2_capture_trigger() argument
663 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_trigger()
682 hal2_capture_pointer(struct snd_pcm_substream *substream) hal2_capture_pointer() argument
684 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_pointer()
687 return snd_pcm_indirect_capture_pointer(substream, &adc->pcm_indirect, hal2_capture_pointer()
691 static void hal2_capture_transfer(struct snd_pcm_substream *substream, hal2_capture_transfer() argument
694 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_transfer()
698 memcpy(substream->runtime->dma_area + rec->sw_data, buf, bytes); hal2_capture_transfer()
701 static int hal2_capture_ack(struct snd_pcm_substream *substream) hal2_capture_ack() argument
703 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); hal2_capture_ack()
706 snd_pcm_indirect_capture_transfer(substream, hal2_capture_ack()
H A Dsgio2audio.c87 struct snd_pcm_substream *substream; member in struct:snd_sgio2audio_chan
369 struct snd_pcm_runtime *runtime = chip->channel[ch].substream->runtime; snd_sgio2audio_dma_pull_frag()
417 struct snd_pcm_runtime *runtime = chip->channel[ch].substream->runtime; snd_sgio2audio_dma_push_frag()
454 static int snd_sgio2audio_dma_start(struct snd_pcm_substream *substream) snd_sgio2audio_dma_start() argument
456 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_dma_start()
457 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_dma_start()
465 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_sgio2audio_dma_start()
475 static int snd_sgio2audio_dma_stop(struct snd_pcm_substream *substream) snd_sgio2audio_dma_stop() argument
477 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_dma_stop()
486 struct snd_pcm_substream *substream; snd_sgio2audio_dma_in_isr() local
490 substream = chan->substream; snd_sgio2audio_dma_in_isr()
491 chip = snd_pcm_substream_chip(substream); snd_sgio2audio_dma_in_isr()
498 snd_pcm_period_elapsed(substream); snd_sgio2audio_dma_in_isr()
506 struct snd_pcm_substream *substream; snd_sgio2audio_dma_out_isr() local
510 substream = chan->substream; snd_sgio2audio_dma_out_isr()
511 chip = snd_pcm_substream_chip(substream); snd_sgio2audio_dma_out_isr()
517 snd_pcm_period_elapsed(substream); snd_sgio2audio_dma_out_isr()
525 struct snd_pcm_substream *substream; snd_sgio2audio_error_isr() local
527 substream = chan->substream; snd_sgio2audio_error_isr()
528 snd_sgio2audio_dma_stop(substream); snd_sgio2audio_error_isr()
529 snd_sgio2audio_dma_start(substream); snd_sgio2audio_error_isr()
554 static int snd_sgio2audio_playback1_open(struct snd_pcm_substream *substream) snd_sgio2audio_playback1_open() argument
556 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_playback1_open()
557 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_playback1_open()
564 static int snd_sgio2audio_playback2_open(struct snd_pcm_substream *substream) snd_sgio2audio_playback2_open() argument
566 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_playback2_open()
567 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_playback2_open()
575 static int snd_sgio2audio_capture_open(struct snd_pcm_substream *substream) snd_sgio2audio_capture_open() argument
577 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_capture_open()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_capture_open()
586 static int snd_sgio2audio_pcm_close(struct snd_pcm_substream *substream) snd_sgio2audio_pcm_close() argument
588 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_pcm_close()
596 static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream, snd_sgio2audio_pcm_hw_params() argument
599 return snd_pcm_lib_alloc_vmalloc_buffer(substream, snd_sgio2audio_pcm_hw_params()
604 static int snd_sgio2audio_pcm_hw_free(struct snd_pcm_substream *substream) snd_sgio2audio_pcm_hw_free() argument
606 return snd_pcm_lib_free_vmalloc_buffer(substream); snd_sgio2audio_pcm_hw_free()
610 static int snd_sgio2audio_pcm_prepare(struct snd_pcm_substream *substream) snd_sgio2audio_pcm_prepare() argument
612 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_pcm_prepare()
613 struct snd_pcm_runtime *runtime = substream->runtime; snd_sgio2audio_pcm_prepare()
614 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_pcm_prepare()
623 chip->channel[ch].substream = substream; snd_sgio2audio_pcm_prepare()
627 switch (substream->stream) { snd_sgio2audio_pcm_prepare()
647 static int snd_sgio2audio_pcm_trigger(struct snd_pcm_substream *substream, snd_sgio2audio_pcm_trigger() argument
653 snd_sgio2audio_dma_start(substream); snd_sgio2audio_pcm_trigger()
657 snd_sgio2audio_dma_stop(substream); snd_sgio2audio_pcm_trigger()
667 snd_sgio2audio_pcm_pointer(struct snd_pcm_substream *substream) snd_sgio2audio_pcm_pointer() argument
669 struct snd_sgio2audio *chip = snd_pcm_substream_chip(substream); snd_sgio2audio_pcm_pointer()
670 struct snd_sgio2audio_chan *chan = substream->runtime->private_data; snd_sgio2audio_pcm_pointer()
673 return bytes_to_frames(substream->runtime, snd_sgio2audio_pcm_pointer()
H A Dau1x00.c84 struct snd_pcm_substream *substream; member in struct:audio_stream
156 struct snd_pcm_substream *substream = stream->substream; au1000_setup_dma_link() local
157 struct snd_pcm_runtime *runtime = substream->runtime; au1000_setup_dma_link()
229 struct snd_pcm_substream *substream = stream->substream; au1000_dma_interrupt() local
256 snd_pcm_period_elapsed(substream); au1000_dma_interrupt()
289 snd_au1000_playback_open(struct snd_pcm_substream *substream) snd_au1000_playback_open() argument
291 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_playback_open()
293 au1000->stream[PLAYBACK]->substream = substream; snd_au1000_playback_open()
295 substream->private_data = au1000->stream[PLAYBACK]; snd_au1000_playback_open()
296 substream->runtime->hw = snd_au1000_hw; snd_au1000_playback_open()
297 return (snd_pcm_hw_constraint_list(substream->runtime, 0, snd_au1000_playback_open()
302 snd_au1000_capture_open(struct snd_pcm_substream *substream) snd_au1000_capture_open() argument
304 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_capture_open()
306 au1000->stream[CAPTURE]->substream = substream; snd_au1000_capture_open()
308 substream->private_data = au1000->stream[CAPTURE]; snd_au1000_capture_open()
309 substream->runtime->hw = snd_au1000_hw; snd_au1000_capture_open()
310 return (snd_pcm_hw_constraint_list(substream->runtime, 0, snd_au1000_capture_open()
315 snd_au1000_playback_close(struct snd_pcm_substream *substream) snd_au1000_playback_close() argument
317 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_playback_close()
319 au1000->stream[PLAYBACK]->substream = NULL; snd_au1000_playback_close()
324 snd_au1000_capture_close(struct snd_pcm_substream *substream) snd_au1000_capture_close() argument
326 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_capture_close()
328 au1000->stream[CAPTURE]->substream = NULL; snd_au1000_capture_close()
333 snd_au1000_hw_params(struct snd_pcm_substream *substream, snd_au1000_hw_params() argument
336 struct audio_stream *stream = substream->private_data; snd_au1000_hw_params()
339 err = snd_pcm_lib_malloc_pages(substream, snd_au1000_hw_params()
349 snd_au1000_hw_free(struct snd_pcm_substream *substream) snd_au1000_hw_free() argument
351 struct audio_stream *stream = substream->private_data; snd_au1000_hw_free()
353 return snd_pcm_lib_free_pages(substream); snd_au1000_hw_free()
357 snd_au1000_playback_prepare(struct snd_pcm_substream *substream) snd_au1000_playback_prepare() argument
359 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_playback_prepare()
360 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_playback_prepare()
371 snd_au1000_capture_prepare(struct snd_pcm_substream *substream) snd_au1000_capture_prepare() argument
373 struct snd_au1000 *au1000 = substream->pcm->private_data; snd_au1000_capture_prepare()
374 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_capture_prepare()
385 snd_au1000_trigger(struct snd_pcm_substream *substream, int cmd) snd_au1000_trigger() argument
387 struct audio_stream *stream = substream->private_data; snd_au1000_trigger()
407 snd_au1000_pointer(struct snd_pcm_substream *substream) snd_au1000_pointer() argument
409 struct audio_stream *stream = substream->private_data; snd_au1000_pointer()
410 struct snd_pcm_runtime *runtime = substream->runtime; snd_au1000_pointer()
/linux-4.1.27/sound/pci/hda/
H A Dhda_controller.c170 azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream) azx_assign_device() argument
174 /* make a non-zero unique key for the substream */ azx_assign_device()
175 int key = (substream->pcm->device << 16) | (substream->number << 2) | azx_assign_device()
176 (substream->stream + 1); azx_assign_device()
178 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { azx_assign_device()
219 struct snd_pcm_substream *substream = azx_dev->substream; azx_cc_read() local
220 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_cc_read()
226 static void azx_timecounter_init(struct snd_pcm_substream *substream, azx_timecounter_init() argument
229 struct azx_dev *azx_dev = get_azx_dev(substream); azx_timecounter_init()
261 to_hda_pcm_stream(struct snd_pcm_substream *substream) to_hda_pcm_stream() argument
263 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); to_hda_pcm_stream()
264 return &apcm->info->stream[substream->stream]; to_hda_pcm_stream()
267 static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream, azx_adjust_codec_delay() argument
270 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_adjust_codec_delay()
271 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_adjust_codec_delay()
277 codec_frames = hinfo->ops.get_delay(hinfo, apcm->codec, substream); azx_adjust_codec_delay()
279 substream->runtime->rate); azx_adjust_codec_delay()
281 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) azx_adjust_codec_delay()
334 struct snd_pcm_substream *substream, azx_setup_periods()
356 struct snd_pcm_runtime *runtime = substream->runtime; azx_setup_periods()
370 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), azx_setup_periods()
381 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), azx_setup_periods()
385 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), azx_setup_periods()
404 static int azx_pcm_close(struct snd_pcm_substream *substream) azx_pcm_close() argument
406 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_close()
407 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_pcm_close()
409 struct azx_dev *azx_dev = get_azx_dev(substream); azx_pcm_close()
414 azx_dev->substream = NULL; azx_pcm_close()
419 hinfo->ops.close(hinfo, apcm->codec, substream); azx_pcm_close()
426 static int azx_pcm_hw_params(struct snd_pcm_substream *substream, azx_pcm_hw_params() argument
429 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_hw_params()
433 dsp_lock(get_azx_dev(substream)); azx_pcm_hw_params()
434 if (dsp_is_locked(get_azx_dev(substream))) { azx_pcm_hw_params()
439 ret = chip->ops->substream_alloc_pages(chip, substream, azx_pcm_hw_params()
442 dsp_unlock(get_azx_dev(substream)); azx_pcm_hw_params()
446 static int azx_pcm_hw_free(struct snd_pcm_substream *substream) azx_pcm_hw_free() argument
448 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_hw_free()
449 struct azx_dev *azx_dev = get_azx_dev(substream); azx_pcm_hw_free()
451 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_pcm_hw_free()
465 snd_hda_codec_cleanup(apcm->codec, hinfo, substream); azx_pcm_hw_free()
467 err = chip->ops->substream_free_pages(chip, substream); azx_pcm_hw_free()
473 static int azx_pcm_prepare(struct snd_pcm_substream *substream) azx_pcm_prepare() argument
475 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_prepare()
477 struct azx_dev *azx_dev = get_azx_dev(substream); azx_pcm_prepare()
478 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_pcm_prepare()
479 struct snd_pcm_runtime *runtime = substream->runtime; azx_pcm_prepare()
507 bufsize = snd_pcm_lib_buffer_bytes(substream); azx_pcm_prepare()
508 period_bytes = snd_pcm_lib_period_bytes(substream); azx_pcm_prepare()
521 err = azx_setup_periods(chip, substream, azx_dev); azx_pcm_prepare()
539 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) azx_pcm_prepare()
551 azx_dev->format_val, substream); azx_pcm_prepare()
560 static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) azx_pcm_trigger() argument
562 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_trigger()
569 azx_dev = get_azx_dev(substream); azx_pcm_trigger()
591 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
592 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
597 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
609 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
610 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
629 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
630 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
645 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
646 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
666 azx_timecounter_init(substream, 0, 0);
667 snd_pcm_gettime(substream->runtime, &substream->runtime->trigger_tstamp);
668 substream->runtime->trigger_tstamp_latched = true;
674 azx_dev = get_azx_dev(substream);
677 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
678 if (s->pcm->card != substream->pcm->card) snd_pcm_group_for_each_entry()
703 struct snd_pcm_substream *substream = azx_dev->substream; azx_get_position() local
705 int stream = substream->stream; azx_get_position()
716 if (substream->runtime) { azx_get_position()
717 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_get_position()
718 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_get_position()
724 substream); azx_get_position()
725 substream->runtime->delay = delay; azx_get_position()
733 static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) azx_pcm_pointer() argument
735 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_pointer()
737 struct azx_dev *azx_dev = get_azx_dev(substream); azx_pcm_pointer()
738 return bytes_to_frames(substream->runtime, azx_pcm_pointer()
742 static int azx_get_time_info(struct snd_pcm_substream *substream, azx_get_time_info() argument
747 struct azx_dev *azx_dev = get_azx_dev(substream); azx_get_time_info()
750 if ((substream->runtime->hw.info & SNDRV_PCM_INFO_HAS_LINK_ATIME) && azx_get_time_info()
753 snd_pcm_gettime(substream->runtime, system_ts); azx_get_time_info()
758 nsec = azx_adjust_codec_delay(substream, nsec); azx_get_time_info()
798 static int azx_pcm_open(struct snd_pcm_substream *substream) azx_pcm_open() argument
800 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_open()
801 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); azx_pcm_open()
804 struct snd_pcm_runtime *runtime = substream->runtime; azx_pcm_open()
811 azx_dev = azx_assign_device(chip, substream); azx_pcm_open()
850 err = hinfo->ops.open(hinfo, apcm->codec, substream); azx_pcm_open()
865 hinfo->ops.close(hinfo, apcm->codec, substream); azx_pcm_open()
872 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { azx_pcm_open()
878 azx_dev->substream = substream; azx_pcm_open()
883 snd_pcm_set_sync(substream); azx_pcm_open()
895 static int azx_pcm_mmap(struct snd_pcm_substream *substream, azx_pcm_mmap() argument
898 struct azx_pcm *apcm = snd_pcm_substream_chip(substream); azx_pcm_mmap()
901 chip->ops->pcm_mmap_prepare(substream, area); azx_pcm_mmap()
902 return snd_pcm_lib_default_mmap(substream, area); azx_pcm_mmap()
1724 if (!azx_dev->substream || !azx_dev->running || azx_interrupt()
1731 snd_pcm_period_elapsed(azx_dev->substream); azx_interrupt()
333 azx_setup_periods(struct azx *chip, struct snd_pcm_substream *substream, struct azx_dev *azx_dev) azx_setup_periods() argument
H A Dpatch_si3054.c153 struct snd_pcm_substream *substream) si3054_pcm_prepare()
157 SET_REG(codec, SI3054_LINE_RATE, substream->runtime->rate); si3054_pcm_prepare()
159 val &= 0xff << (8 * (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)); si3054_pcm_prepare()
160 val |= ((stream_tag & 0xf) << 4) << (8 * (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); si3054_pcm_prepare()
170 struct snd_pcm_substream *substream) si3054_pcm_open()
178 substream->runtime->hw.period_bytes_min = 80; si3054_pcm_open()
179 return snd_pcm_hw_constraint_list(substream->runtime, 0, si3054_pcm_open()
149 si3054_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, struct snd_pcm_substream *substream) si3054_pcm_prepare() argument
168 si3054_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, struct snd_pcm_substream *substream) si3054_pcm_open() argument
/linux-4.1.27/sound/soc/ux500/
H A Dux500_pcm.c50 struct snd_pcm_substream *substream) ux500_pcm_request_chan()
57 dma_params = snd_soc_dai_get_dma_data(dai, substream); ux500_pcm_request_chan()
76 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ux500_pcm_request_chan()
87 static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, ux500_pcm_prepare_slave_config() argument
91 struct snd_soc_pcm_runtime *rtd = substream->private_data; ux500_pcm_prepare_slave_config()
100 snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); ux500_pcm_prepare_slave_config()
104 snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); ux500_pcm_prepare_slave_config()
108 ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); ux500_pcm_prepare_slave_config()
118 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ux500_pcm_prepare_slave_config()
49 ux500_pcm_request_chan(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream) ux500_pcm_request_chan() argument
H A Dmop500_ab8500.c194 static int mop500_ab8500_startup(struct snd_pcm_substream *substream) mop500_ab8500_startup() argument
196 struct snd_soc_pcm_runtime *rtd = substream->private_data; mop500_ab8500_startup()
203 static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) mop500_ab8500_shutdown() argument
205 struct snd_soc_pcm_runtime *rtd = substream->private_data; mop500_ab8500_shutdown()
211 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) mop500_ab8500_shutdown()
217 static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, mop500_ab8500_hw_params() argument
220 struct snd_soc_pcm_runtime *rtd = substream->private_data; mop500_ab8500_hw_params()
231 dev_dbg(dev, "%s: substream->pcm->name = %s\n" mop500_ab8500_hw_params()
232 "substream->pcm->id = %s.\n" mop500_ab8500_hw_params()
233 "substream->name = %s.\n" mop500_ab8500_hw_params()
234 "substream->number = %d.\n", mop500_ab8500_hw_params()
236 substream->pcm->name, mop500_ab8500_hw_params()
237 substream->pcm->id, mop500_ab8500_hw_params()
238 substream->name, mop500_ab8500_hw_params()
239 substream->number); mop500_ab8500_hw_params()
299 is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); mop500_ab8500_hw_params()
342 static int mop500_ab8500_hw_free(struct snd_pcm_substream *substream) mop500_ab8500_hw_free() argument
344 struct snd_soc_pcm_runtime *rtd = substream->private_data; mop500_ab8500_hw_free()
H A Dux500_msp_dai.c303 static int setup_msp_config(struct snd_pcm_substream *substream, setup_msp_config() argument
309 struct snd_pcm_runtime *runtime = substream->runtime; setup_msp_config()
320 msp_config->direction = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? setup_msp_config()
385 static int ux500_msp_dai_startup(struct snd_pcm_substream *substream, ux500_msp_dai_startup() argument
392 snd_pcm_stream_str(substream)); ux500_msp_dai_startup()
426 static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, ux500_msp_dai_shutdown() argument
431 bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); ux500_msp_dai_shutdown()
434 snd_pcm_stream_str(substream)); ux500_msp_dai_shutdown()
446 __func__, dai->id, snd_pcm_stream_str(substream)); ux500_msp_dai_shutdown()
461 static int ux500_msp_dai_prepare(struct snd_pcm_substream *substream, ux500_msp_dai_prepare() argument
466 struct snd_pcm_runtime *runtime = substream->runtime; ux500_msp_dai_prepare()
470 dai->id, snd_pcm_stream_str(substream), runtime->rate); ux500_msp_dai_prepare()
472 setup_msp_config(substream, dai, &msp_config); ux500_msp_dai_prepare()
498 static int ux500_msp_dai_hw_params(struct snd_pcm_substream *substream, ux500_msp_dai_hw_params() argument
503 struct snd_pcm_runtime *runtime = substream->runtime; ux500_msp_dai_hw_params()
507 __func__, dai->id, snd_pcm_stream_str(substream)); ux500_msp_dai_hw_params()
518 mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? ux500_msp_dai_hw_params()
644 static int ux500_msp_dai_trigger(struct snd_pcm_substream *substream, ux500_msp_dai_trigger() argument
651 __func__, dai->id, snd_pcm_stream_str(substream), ux500_msp_dai_trigger()
654 ret = ux500_msp_i2s_trigger(drvdata->msp, cmd, substream->stream); ux500_msp_dai_trigger()
/linux-4.1.27/sound/drivers/
H A Dmtpav.c289 struct snd_rawmidi_substream *substream) snd_mtpav_output_port_write()
295 if (snd_rawmidi_transmit(substream, &outbyte, 1) != 1) snd_mtpav_output_port_write()
320 } while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1); snd_mtpav_output_port_write()
323 static void snd_mtpav_output_write(struct snd_rawmidi_substream *substream) snd_mtpav_output_write() argument
325 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_output_write()
326 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_output_write()
330 snd_mtpav_output_port_write(mtp_card, portp, substream); snd_mtpav_output_write()
353 static int snd_mtpav_input_open(struct snd_rawmidi_substream *substream) snd_mtpav_input_open() argument
355 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_input_open()
356 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_input_open()
361 portp->input = substream; snd_mtpav_input_open()
371 static int snd_mtpav_input_close(struct snd_rawmidi_substream *substream) snd_mtpav_input_close() argument
373 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_input_close()
374 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_input_close()
389 static void snd_mtpav_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_mtpav_input_trigger() argument
391 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_input_trigger()
392 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_input_trigger()
442 static int snd_mtpav_output_open(struct snd_rawmidi_substream *substream) snd_mtpav_output_open() argument
444 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_output_open()
445 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_output_open()
450 portp->output = substream; snd_mtpav_output_open()
458 static int snd_mtpav_output_close(struct snd_rawmidi_substream *substream) snd_mtpav_output_close() argument
460 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_output_close()
461 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_output_close()
474 static void snd_mtpav_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_mtpav_output_trigger() argument
476 struct mtpav *mtp_card = substream->rmidi->private_data; snd_mtpav_output_trigger()
477 struct mtpav_port *portp = &mtp_card->ports[substream->number]; snd_mtpav_output_trigger()
495 snd_mtpav_output_write(substream); snd_mtpav_output_trigger()
621 struct snd_rawmidi_substream *substream) snd_mtpav_set_name()
623 if (substream->number >= 0 && substream->number < chip->num_ports) snd_mtpav_set_name()
624 sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1); snd_mtpav_set_name()
625 else if (substream->number >= 8 && substream->number < chip->num_ports * 2) snd_mtpav_set_name()
626 sprintf(substream->name, "MTP remote %d", (substream->number % chip->num_ports) + 1); snd_mtpav_set_name()
627 else if (substream->number == chip->num_ports * 2) snd_mtpav_set_name()
628 strcpy(substream->name, "MTP computer"); snd_mtpav_set_name()
629 else if (substream->number == chip->num_ports * 2 + 1) snd_mtpav_set_name()
630 strcpy(substream->name, "MTP ADAT"); snd_mtpav_set_name()
632 strcpy(substream->name, "MTP broadcast"); snd_mtpav_set_name()
639 struct snd_rawmidi_substream *substream; snd_mtpav_get_RAWMIDI() local
657 substream = list_entry(list, struct snd_rawmidi_substream, list); snd_mtpav_get_RAWMIDI()
658 snd_mtpav_set_name(mcard, substream); snd_mtpav_get_RAWMIDI()
659 substream->ops = &snd_mtpav_input; snd_mtpav_get_RAWMIDI()
662 substream = list_entry(list, struct snd_rawmidi_substream, list); snd_mtpav_get_RAWMIDI()
663 snd_mtpav_set_name(mcard, substream); snd_mtpav_get_RAWMIDI()
664 substream->ops = &snd_mtpav_output; snd_mtpav_get_RAWMIDI()
665 mcard->ports[substream->number].hwport = translate_subdevice_to_hwport(mcard, substream->number); snd_mtpav_get_RAWMIDI()
287 snd_mtpav_output_port_write(struct mtpav *mtp_card, struct mtpav_port *portp, struct snd_rawmidi_substream *substream) snd_mtpav_output_port_write() argument
620 snd_mtpav_set_name(struct mtpav *chip, struct snd_rawmidi_substream *substream) snd_mtpav_set_name() argument
H A Ddummy.c112 #define get_dummy_ops(substream) \
113 (*(const struct dummy_timer_ops **)(substream)->runtime->private_data)
247 struct snd_pcm_substream *substream; member in struct:dummy_systimer_pcm
275 static int dummy_systimer_start(struct snd_pcm_substream *substream) dummy_systimer_start() argument
277 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_start()
285 static int dummy_systimer_stop(struct snd_pcm_substream *substream) dummy_systimer_stop() argument
287 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_stop()
294 static int dummy_systimer_prepare(struct snd_pcm_substream *substream) dummy_systimer_prepare() argument
296 struct snd_pcm_runtime *runtime = substream->runtime; dummy_systimer_prepare()
322 snd_pcm_period_elapsed(dpcm->substream); dummy_systimer_callback()
326 dummy_systimer_pointer(struct snd_pcm_substream *substream) dummy_systimer_pointer() argument
328 struct dummy_systimer_pcm *dpcm = substream->runtime->private_data; dummy_systimer_pointer()
338 static int dummy_systimer_create(struct snd_pcm_substream *substream) dummy_systimer_create() argument
345 substream->runtime->private_data = dpcm; dummy_systimer_create()
349 dpcm->substream = substream; dummy_systimer_create()
353 static void dummy_systimer_free(struct snd_pcm_substream *substream) dummy_systimer_free() argument
355 kfree(substream->runtime->private_data); dummy_systimer_free()
380 struct snd_pcm_substream *substream; member in struct:dummy_hrtimer_pcm
387 snd_pcm_period_elapsed(dpcm->substream); dummy_hrtimer_pcm_elapsed()
402 static int dummy_hrtimer_start(struct snd_pcm_substream *substream) dummy_hrtimer_start() argument
404 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_start()
412 static int dummy_hrtimer_stop(struct snd_pcm_substream *substream) dummy_hrtimer_stop() argument
414 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_stop()
427 dummy_hrtimer_pointer(struct snd_pcm_substream *substream) dummy_hrtimer_pointer() argument
429 struct snd_pcm_runtime *runtime = substream->runtime; dummy_hrtimer_pointer()
441 static int dummy_hrtimer_prepare(struct snd_pcm_substream *substream) dummy_hrtimer_prepare() argument
443 struct snd_pcm_runtime *runtime = substream->runtime; dummy_hrtimer_prepare()
460 static int dummy_hrtimer_create(struct snd_pcm_substream *substream) dummy_hrtimer_create() argument
467 substream->runtime->private_data = dpcm; dummy_hrtimer_create()
470 dpcm->substream = substream; dummy_hrtimer_create()
477 static void dummy_hrtimer_free(struct snd_pcm_substream *substream) dummy_hrtimer_free() argument
479 struct dummy_hrtimer_pcm *dpcm = substream->runtime->private_data; dummy_hrtimer_free()
499 static int dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd) dummy_pcm_trigger() argument
504 return get_dummy_ops(substream)->start(substream); dummy_pcm_trigger()
507 return get_dummy_ops(substream)->stop(substream); dummy_pcm_trigger()
512 static int dummy_pcm_prepare(struct snd_pcm_substream *substream) dummy_pcm_prepare() argument
514 return get_dummy_ops(substream)->prepare(substream); dummy_pcm_prepare()
517 static snd_pcm_uframes_t dummy_pcm_pointer(struct snd_pcm_substream *substream) dummy_pcm_pointer() argument
519 return get_dummy_ops(substream)->pointer(substream); dummy_pcm_pointer()
541 static int dummy_pcm_hw_params(struct snd_pcm_substream *substream, dummy_pcm_hw_params() argument
546 substream->runtime->dma_bytes = params_buffer_bytes(hw_params); dummy_pcm_hw_params()
549 return snd_pcm_lib_malloc_pages(substream, dummy_pcm_hw_params()
553 static int dummy_pcm_hw_free(struct snd_pcm_substream *substream) dummy_pcm_hw_free() argument
557 return snd_pcm_lib_free_pages(substream); dummy_pcm_hw_free()
560 static int dummy_pcm_open(struct snd_pcm_substream *substream) dummy_pcm_open() argument
562 struct snd_dummy *dummy = snd_pcm_substream_chip(substream); dummy_pcm_open()
564 struct snd_pcm_runtime *runtime = substream->runtime; dummy_pcm_open()
574 err = ops->create(substream); dummy_pcm_open()
577 get_dummy_ops(substream) = ops; dummy_pcm_open()
580 if (substream->pcm->device & 1) { dummy_pcm_open()
584 if (substream->pcm->device & 2) dummy_pcm_open()
591 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dummy_pcm_open()
593 err = model->playback_constraints(substream->runtime); dummy_pcm_open()
596 err = model->capture_constraints(substream->runtime); dummy_pcm_open()
599 get_dummy_ops(substream)->free(substream); dummy_pcm_open()
605 static int dummy_pcm_close(struct snd_pcm_substream *substream) dummy_pcm_close() argument
607 get_dummy_ops(substream)->free(substream); dummy_pcm_close()
645 static int dummy_pcm_copy(struct snd_pcm_substream *substream, dummy_pcm_copy() argument
652 static int dummy_pcm_silence(struct snd_pcm_substream *substream, dummy_pcm_silence() argument
659 static struct page *dummy_pcm_page(struct snd_pcm_substream *substream, dummy_pcm_page() argument
662 return virt_to_page(dummy_page[substream->stream]); /* the same page */ dummy_pcm_page()
H A Daloop.c105 struct snd_pcm_substream *substream; member in struct:loopback_pcm
151 int device = dpcm->substream->pstr->pcm->device; get_setup()
153 if (dpcm->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) get_setup()
155 return &dpcm->loopback->setup[dpcm->substream->number][device]; get_setup()
211 substream->runtime; loopback_check_format()
213 substream->runtime; loopback_check_format()
223 substream, SNDRV_PCM_STATE_DRAINING); loopback_check_format()
226 substream->runtime; loopback_check_format()
255 static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) loopback_trigger() argument
257 struct snd_pcm_runtime *runtime = substream->runtime; loopback_trigger()
260 int err, stream = 1 << substream->stream; loopback_trigger()
264 err = loopback_check_format(cable, substream->stream); loopback_trigger()
275 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) loopback_trigger()
284 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) loopback_trigger()
313 if (dpcm == NULL || dpcm->substream == NULL) params_change_substream()
315 dst_runtime = dpcm->substream->runtime; params_change_substream()
321 static void params_change(struct snd_pcm_substream *substream) params_change() argument
323 struct snd_pcm_runtime *runtime = substream->runtime; params_change()
338 static int loopback_prepare(struct snd_pcm_substream *substream) loopback_prepare() argument
340 struct snd_pcm_runtime *runtime = substream->runtime; loopback_prepare()
353 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { loopback_prepare()
367 if (!(cable->valid & ~(1 << substream->stream)) || loopback_prepare()
369 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) loopback_prepare()
370 params_change(substream); loopback_prepare()
371 cable->valid |= 1 << substream->stream; loopback_prepare()
379 struct snd_pcm_runtime *runtime = dpcm->substream->runtime; clear_capture_buf()
407 struct snd_pcm_runtime *runtime = play->substream->runtime; copy_play_buf()
409 char *dst = capt->substream->runtime->dma_area; copy_play_buf()
538 if (loopback_pos_update(dpcm->cable) & (1 << dpcm->substream->stream)) { loopback_timer_function()
544 snd_pcm_period_elapsed(dpcm->substream); loopback_timer_function()
551 static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream) loopback_pointer() argument
553 struct snd_pcm_runtime *runtime = substream->runtime; loopback_pointer()
593 static int loopback_hw_params(struct snd_pcm_substream *substream, loopback_hw_params() argument
596 return snd_pcm_lib_alloc_vmalloc_buffer(substream, loopback_hw_params()
600 static int loopback_hw_free(struct snd_pcm_substream *substream) loopback_hw_free() argument
602 struct snd_pcm_runtime *runtime = substream->runtime; loopback_hw_free()
607 cable->valid &= ~(1 << substream->stream); loopback_hw_free()
609 return snd_pcm_lib_free_vmalloc_buffer(substream); loopback_hw_free()
612 static unsigned int get_cable_index(struct snd_pcm_substream *substream) get_cable_index() argument
614 if (!substream->pcm->device) get_cable_index()
615 return substream->stream; get_cable_index()
617 return !substream->stream; get_cable_index()
661 static int loopback_open(struct snd_pcm_substream *substream) loopback_open() argument
663 struct snd_pcm_runtime *runtime = substream->runtime; loopback_open()
664 struct loopback *loopback = substream->private_data; loopback_open()
668 int dev = get_cable_index(substream); loopback_open()
677 dpcm->substream = substream; loopback_open()
681 cable = loopback->cables[substream->number][dev]; loopback_open()
691 loopback->cables[substream->number][dev] = cable; loopback_open()
694 cable->streams[substream->stream] = dpcm; loopback_open()
731 static int loopback_close(struct snd_pcm_substream *substream) loopback_close() argument
733 struct loopback *loopback = substream->private_data; loopback_close()
734 struct loopback_pcm *dpcm = substream->runtime->private_data; loopback_close()
736 int dev = get_cable_index(substream); loopback_close()
740 cable = loopback->cables[substream->number][dev]; loopback_close()
741 if (cable->streams[!substream->stream]) { loopback_close()
743 cable->streams[substream->stream] = NULL; loopback_close()
746 loopback->cables[substream->number][dev] = NULL; loopback_close()
1090 snd_iprintf(buffer, "Cable %i substream %i:\n", num, sub); print_substream_info()
H A Dpcm-indirect2.c40 void snd_pcm_indirect2_stat(struct snd_pcm_substream *substream, snd_pcm_indirect2_stat() argument
43 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_stat()
136 snd_pcm_indirect2_increase_min_periods(struct snd_pcm_substream *substream, snd_pcm_indirect2_increase_min_periods() argument
154 snd_pcm_lib_period_bytes(substream)) { snd_pcm_indirect2_increase_min_periods()
159 (substream))) * snd_pcm_indirect2_increase_min_periods()
161 (substream); snd_pcm_indirect2_increase_min_periods()
232 snd_pcm_indirect2_pointer(struct snd_pcm_substream *substream, snd_pcm_indirect2_pointer() argument
238 return bytes_to_frames(substream->runtime, rec->sw_io); snd_pcm_indirect2_pointer()
245 snd_pcm_indirect2_playback_transfer(struct snd_pcm_substream *substream, snd_pcm_indirect2_playback_transfer() argument
250 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_playback_transfer()
295 bytes = zero(substream, rec); snd_pcm_indirect2_playback_transfer()
307 snd_pcm_indirect2_increase_min_periods(substream, rec, 1, 0, snd_pcm_indirect2_playback_transfer()
335 bytes = copy(substream, rec, bytes); snd_pcm_indirect2_playback_transfer()
358 snd_pcm_indirect2_increase_min_periods(substream, rec, 1, 1, snd_pcm_indirect2_playback_transfer()
374 snd_pcm_indirect2_playback_interrupt(struct snd_pcm_substream *substream, snd_pcm_indirect2_playback_interrupt() argument
388 snd_pcm_indirect2_playback_transfer(substream, rec, copy, zero); snd_pcm_indirect2_playback_interrupt()
405 snd_pcm_period_elapsed(substream); snd_pcm_indirect2_playback_interrupt()
413 snd_pcm_indirect2_capture_transfer(struct snd_pcm_substream *substream, snd_pcm_indirect2_capture_transfer() argument
418 struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_indirect2_capture_transfer()
456 bytes = null(substream, rec); snd_pcm_indirect2_capture_transfer()
468 snd_pcm_indirect2_increase_min_periods(substream, rec, 0, 0, snd_pcm_indirect2_capture_transfer()
503 bytes = copy(substream, rec, bytes); snd_pcm_indirect2_capture_transfer()
522 snd_pcm_indirect2_increase_min_periods(substream, rec, 0, 1, snd_pcm_indirect2_capture_transfer()
537 snd_pcm_indirect2_capture_interrupt(struct snd_pcm_substream *substream, snd_pcm_indirect2_capture_interrupt() argument
553 snd_pcm_indirect2_capture_transfer(substream, rec, copy, null); snd_pcm_indirect2_capture_interrupt()
571 snd_pcm_period_elapsed(substream); snd_pcm_indirect2_capture_interrupt()
H A Dmts64.c267 /* map hardware port to substream number
271 * the midiport (substream number).
272 * substream 0-3 are Midiports 1-4
273 * substream 4 is SMPTE Timecode
686 static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream) snd_mts64_rawmidi_open() argument
688 struct mts64 *mts = substream->rmidi->private_data; snd_mts64_rawmidi_open()
703 static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream) snd_mts64_rawmidi_close() argument
705 struct mts64 *mts = substream->rmidi->private_data; snd_mts64_rawmidi_close()
724 static void snd_mts64_rawmidi_output_trigger(struct snd_rawmidi_substream *substream, snd_mts64_rawmidi_output_trigger() argument
727 struct mts64 *mts = substream->rmidi->private_data; snd_mts64_rawmidi_output_trigger()
732 while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) { snd_mts64_rawmidi_output_trigger()
733 mts64_write_midi(mts, data, substream->number+1); snd_mts64_rawmidi_output_trigger()
734 snd_rawmidi_transmit_ack(substream, 1); snd_mts64_rawmidi_output_trigger()
739 static void snd_mts64_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, snd_mts64_rawmidi_input_trigger() argument
742 struct mts64 *mts = substream->rmidi->private_data; snd_mts64_rawmidi_input_trigger()
747 mts->mode[substream->number] |= MTS64_MODE_INPUT_TRIGGERED; snd_mts64_rawmidi_input_trigger()
749 mts->mode[substream->number] &= ~MTS64_MODE_INPUT_TRIGGERED; snd_mts64_rawmidi_input_trigger()
771 struct snd_rawmidi_substream *substream; snd_mts64_rawmidi_create() local
800 substream = list_entry(list, struct snd_rawmidi_substream, list); snd_mts64_rawmidi_create()
801 sprintf(substream->name, snd_mts64_rawmidi_create()
802 "Miditerminal %d", substream->number+1); snd_mts64_rawmidi_create()
807 substream = list_entry(list, struct snd_rawmidi_substream, list); snd_mts64_rawmidi_create()
808 mts->midi_input_substream[substream->number] = substream; snd_mts64_rawmidi_create()
809 switch(substream->number) { snd_mts64_rawmidi_create()
811 strcpy(substream->name, "Miditerminal SMPTE"); snd_mts64_rawmidi_create()
814 sprintf(substream->name, snd_mts64_rawmidi_create()
815 "Miditerminal %d", substream->number+1); snd_mts64_rawmidi_create()
833 struct snd_rawmidi_substream *substream; snd_mts64_interrupt() local
845 substream = mts->midi_input_substream[mts->current_midi_input_port]; snd_mts64_interrupt()
846 if (mts->mode[substream->number] & MTS64_MODE_INPUT_TRIGGERED) snd_mts64_interrupt()
847 snd_rawmidi_receive(substream, &data, 1); snd_mts64_interrupt()
H A Dml403-ac97cr.c415 snd_ml403_ac97cr_playback_ind2_zero(struct snd_pcm_substream *substream, snd_ml403_ac97cr_playback_ind2_zero() argument
422 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_playback_ind2_zero()
437 snd_ml403_ac97cr_playback_ind2_copy(struct snd_pcm_substream *substream, snd_ml403_ac97cr_playback_ind2_copy() argument
446 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_playback_ind2_copy()
447 src = (u16 *)(substream->runtime->dma_area + rec->sw_data); snd_ml403_ac97cr_playback_ind2_copy()
467 snd_ml403_ac97cr_capture_ind2_null(struct snd_pcm_substream *substream, snd_ml403_ac97cr_capture_ind2_null() argument
474 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_capture_ind2_null()
495 snd_ml403_ac97cr_capture_ind2_copy(struct snd_pcm_substream *substream, snd_ml403_ac97cr_capture_ind2_copy() argument
503 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_capture_ind2_copy()
504 dst = (u16 *)(substream->runtime->dma_area + rec->sw_data); snd_ml403_ac97cr_capture_ind2_copy()
524 snd_ml403_ac97cr_pcm_pointer(struct snd_pcm_substream *substream) snd_ml403_ac97cr_pcm_pointer() argument
529 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_pcm_pointer()
531 if (substream == ml403_ac97cr->playback_substream) snd_ml403_ac97cr_pcm_pointer()
533 if (substream == ml403_ac97cr->capture_substream) snd_ml403_ac97cr_pcm_pointer()
537 return snd_pcm_indirect2_pointer(substream, ind2_rec); snd_ml403_ac97cr_pcm_pointer()
542 snd_ml403_ac97cr_pcm_playback_trigger(struct snd_pcm_substream *substream, snd_ml403_ac97cr_pcm_playback_trigger() argument
548 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_pcm_playback_trigger()
566 snd_pcm_indirect2_stat(substream, &ml403_ac97cr->ind_rec); snd_ml403_ac97cr_pcm_playback_trigger()
581 snd_ml403_ac97cr_pcm_capture_trigger(struct snd_pcm_substream *substream, snd_ml403_ac97cr_pcm_capture_trigger() argument
587 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_pcm_capture_trigger()
605 snd_pcm_indirect2_stat(substream, snd_ml403_ac97cr_pcm_capture_trigger()
621 snd_ml403_ac97cr_pcm_playback_prepare(struct snd_pcm_substream *substream) snd_ml403_ac97cr_pcm_playback_prepare() argument
626 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_pcm_playback_prepare()
627 runtime = substream->runtime; snd_ml403_ac97cr_pcm_playback_prepare()
631 snd_pcm_lib_period_bytes(substream), CR_FIFO_SIZE / 2); snd_ml403_ac97cr_pcm_playback_prepare()
643 snd_pcm_lib_buffer_bytes(substream); snd_ml403_ac97cr_pcm_playback_prepare()
646 snd_pcm_lib_period_bytes(substream) / (CR_FIFO_SIZE / 2); snd_ml403_ac97cr_pcm_playback_prepare()
655 snd_ml403_ac97cr_pcm_capture_prepare(struct snd_pcm_substream *substream) snd_ml403_ac97cr_pcm_capture_prepare() argument
660 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_pcm_capture_prepare()
661 runtime = substream->runtime; snd_ml403_ac97cr_pcm_capture_prepare()
665 snd_pcm_lib_period_bytes(substream), CR_FIFO_SIZE / 2); snd_ml403_ac97cr_pcm_capture_prepare()
677 snd_pcm_lib_buffer_bytes(substream); snd_ml403_ac97cr_pcm_capture_prepare()
679 snd_pcm_lib_period_bytes(substream) / (CR_FIFO_SIZE / 2); snd_ml403_ac97cr_pcm_capture_prepare()
687 static int snd_ml403_ac97cr_hw_free(struct snd_pcm_substream *substream) snd_ml403_ac97cr_hw_free() argument
690 return snd_pcm_lib_free_pages(substream); snd_ml403_ac97cr_hw_free()
694 snd_ml403_ac97cr_hw_params(struct snd_pcm_substream *substream, snd_ml403_ac97cr_hw_params() argument
700 return snd_pcm_lib_malloc_pages(substream, snd_ml403_ac97cr_hw_params()
704 static int snd_ml403_ac97cr_playback_open(struct snd_pcm_substream *substream) snd_ml403_ac97cr_playback_open() argument
709 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_playback_open()
710 runtime = substream->runtime; snd_ml403_ac97cr_playback_open()
713 ml403_ac97cr->playback_substream = substream; snd_ml403_ac97cr_playback_open()
722 static int snd_ml403_ac97cr_capture_open(struct snd_pcm_substream *substream) snd_ml403_ac97cr_capture_open() argument
727 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_capture_open()
728 runtime = substream->runtime; snd_ml403_ac97cr_capture_open()
731 ml403_ac97cr->capture_substream = substream; snd_ml403_ac97cr_capture_open()
740 static int snd_ml403_ac97cr_playback_close(struct snd_pcm_substream *substream) snd_ml403_ac97cr_playback_close() argument
744 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_playback_close()
751 static int snd_ml403_ac97cr_capture_close(struct snd_pcm_substream *substream) snd_ml403_ac97cr_capture_close() argument
755 ml403_ac97cr = snd_pcm_substream_chip(substream); snd_ml403_ac97cr_capture_close()
H A Dserial-u16550.c210 int substream; snd_uart16550_io_loop() local
213 substream = uart->prev_in; snd_uart16550_io_loop()
228 substream = c - 1; snd_uart16550_io_loop()
234 && uart->midi_input[substream]) snd_uart16550_io_loop()
235 snd_rawmidi_receive(uart->midi_input[substream], snd_uart16550_io_loop()
238 uart->midi_input[substream]) snd_uart16550_io_loop()
239 snd_rawmidi_receive(uart->midi_input[substream], &c, 1); snd_uart16550_io_loop()
248 uart->prev_in = substream; snd_uart16550_io_loop()
515 static int snd_uart16550_input_open(struct snd_rawmidi_substream *substream) snd_uart16550_input_open() argument
518 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_input_open()
524 uart->midi_input[substream->number] = substream; snd_uart16550_input_open()
529 static int snd_uart16550_input_close(struct snd_rawmidi_substream *substream) snd_uart16550_input_close() argument
532 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_input_close()
536 uart->midi_input[substream->number] = NULL; snd_uart16550_input_close()
543 static void snd_uart16550_input_trigger(struct snd_rawmidi_substream *substream, snd_uart16550_input_trigger() argument
547 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_input_trigger()
557 static int snd_uart16550_output_open(struct snd_rawmidi_substream *substream) snd_uart16550_output_open() argument
560 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_output_open()
566 uart->midi_output[substream->number] = substream; snd_uart16550_output_open()
571 static int snd_uart16550_output_close(struct snd_rawmidi_substream *substream) snd_uart16550_output_close() argument
574 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_output_close()
578 uart->midi_output[substream->number] = NULL; snd_uart16550_output_close()
612 struct snd_rawmidi_substream *substream, snd_uart16550_output_byte()
648 static void snd_uart16550_output_write(struct snd_rawmidi_substream *substream) snd_uart16550_output_write() argument
652 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_output_write()
672 if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1) snd_uart16550_output_write()
676 addr_byte = (1 << (substream->number + 4)) | 0x08; snd_uart16550_output_write()
679 addr_byte = (substream->number << 4) | 0x08; snd_uart16550_output_write()
684 snd_uart16550_output_byte(uart, substream, addr_byte); snd_uart16550_output_write()
686 snd_uart16550_output_byte(uart, substream, midi_byte); snd_uart16550_output_write()
690 while (snd_rawmidi_transmit_peek(substream, &midi_byte, 1) == 1) { snd_uart16550_output_write()
696 (uart->prev_out != substream->number || snd_uart16550_output_write()
701 /* If this substream of the data is snd_uart16550_output_write()
702 * different previous substream snd_uart16550_output_write()
706 uart->prev_out = substream->number; snd_uart16550_output_write()
708 snd_uart16550_output_byte(uart, substream, snd_uart16550_output_write()
711 snd_uart16550_output_byte(uart, substream, snd_uart16550_output_write()
717 snd_uart16550_output_byte(uart, substream, uart->prev_status[uart->prev_out]); snd_uart16550_output_write()
724 if (!snd_uart16550_output_byte(uart, substream, midi_byte) && snd_uart16550_output_write()
732 snd_rawmidi_transmit_ack( substream, 1 ); snd_uart16550_output_write()
739 static void snd_uart16550_output_trigger(struct snd_rawmidi_substream *substream, snd_uart16550_output_trigger() argument
743 struct snd_uart16550 *uart = substream->rmidi->private_data; snd_uart16550_output_trigger()
752 snd_uart16550_output_write(substream); snd_uart16550_output_trigger()
865 struct snd_rawmidi_substream *substream; snd_uart16550_substreams() local
867 list_for_each_entry(substream, &stream->substreams, list) { snd_uart16550_substreams()
868 sprintf(substream->name, "Serial MIDI %d", substream->number + 1); snd_uart16550_substreams()
611 snd_uart16550_output_byte(struct snd_uart16550 *uart, struct snd_rawmidi_substream *substream, unsigned char midi_byte) snd_uart16550_output_byte() argument
H A Dpcm-indirect2.h115 typedef size_t (*snd_pcm_indirect2_copy_t) (struct snd_pcm_substream *substream,
118 typedef size_t (*snd_pcm_indirect2_zero_t) (struct snd_pcm_substream *substream,
122 void snd_pcm_indirect2_stat(struct snd_pcm_substream *substream,
127 snd_pcm_indirect2_pointer(struct snd_pcm_substream *substream,
130 snd_pcm_indirect2_playback_interrupt(struct snd_pcm_substream *substream,
135 snd_pcm_indirect2_capture_interrupt(struct snd_pcm_substream *substream,
H A Dportman2x4.c512 static int snd_portman_midi_open(struct snd_rawmidi_substream *substream) snd_portman_midi_open() argument
517 static int snd_portman_midi_close(struct snd_rawmidi_substream *substream) snd_portman_midi_close() argument
522 static void snd_portman_midi_input_trigger(struct snd_rawmidi_substream *substream, snd_portman_midi_input_trigger() argument
525 struct portman *pm = substream->rmidi->private_data; snd_portman_midi_input_trigger()
530 pm->mode[substream->number] |= PORTMAN2X4_MODE_INPUT_TRIGGERED; snd_portman_midi_input_trigger()
532 pm->mode[substream->number] &= ~PORTMAN2X4_MODE_INPUT_TRIGGERED; snd_portman_midi_input_trigger()
536 static void snd_portman_midi_output_trigger(struct snd_rawmidi_substream *substream, snd_portman_midi_output_trigger() argument
539 struct portman *pm = substream->rmidi->private_data; snd_portman_midi_output_trigger()
545 while ((snd_rawmidi_transmit(substream, &byte, 1) == 1)) snd_portman_midi_output_trigger()
546 portman_write_midi(pm, substream->number, byte); snd_portman_midi_output_trigger()
568 struct snd_rawmidi_substream *substream; snd_portman_rawmidi_create() local
594 list_for_each_entry(substream, snd_portman_rawmidi_create()
597 sprintf(substream->name, snd_portman_rawmidi_create()
598 "Portman2x4 %d", substream->number+1); snd_portman_rawmidi_create()
601 list_for_each_entry(substream, snd_portman_rawmidi_create()
604 pm->midi_input[substream->number] = substream; snd_portman_rawmidi_create()
605 sprintf(substream->name, snd_portman_rawmidi_create()
606 "Portman2x4 %d", substream->number+1); snd_portman_rawmidi_create()
/linux-4.1.27/drivers/usb/gadget/function/
H A Du_uac1.c97 struct snd_pcm_substream *substream = snd->substream; playback_default_hw_params() local
126 snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); playback_default_hw_params()
127 snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, params); playback_default_hw_params()
129 result = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_PREPARE, NULL); playback_default_hw_params()
158 struct snd_pcm_substream *substream = snd->substream; u_audio_playback() local
159 struct snd_pcm_runtime *runtime = substream->runtime; u_audio_playback()
167 result = snd_pcm_kernel_ioctl(substream, u_audio_playback()
179 result = snd_pcm_lib_write(snd->substream, (void __user *)buf, frames); u_audio_playback()
228 /* Open PCM playback device and setup substream */ gaudio_open_snd_dev()
239 snd->substream = pcm_file->substream; gaudio_open_snd_dev()
243 /* Open PCM capture device and setup substream */ gaudio_open_snd_dev()
248 snd->substream = NULL; gaudio_open_snd_dev()
253 snd->substream = pcm_file->substream; gaudio_open_snd_dev()
272 /* Close PCM playback device and setup substream */ gaudio_close_snd_dev()
277 /* Close PCM capture device and setup substream */ gaudio_close_snd_dev()
H A Df_uac2.c179 struct snd_pcm_substream *substream; agdev_iso_complete() local
195 substream = prm->ss; agdev_iso_complete()
198 if (!substream) agdev_iso_complete()
203 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { agdev_iso_complete()
240 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { agdev_iso_complete()
263 snd_pcm_period_elapsed(substream); agdev_iso_complete()
269 uac2_pcm_trigger(struct snd_pcm_substream *substream, int cmd) uac2_pcm_trigger() argument
271 struct snd_uac2_chip *uac2 = snd_pcm_substream_chip(substream); uac2_pcm_trigger()
276 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) uac2_pcm_trigger()
289 prm->ss = substream; uac2_pcm_trigger()
302 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !prm->ss) uac2_pcm_trigger()
308 static snd_pcm_uframes_t uac2_pcm_pointer(struct snd_pcm_substream *substream) uac2_pcm_pointer() argument
310 struct snd_uac2_chip *uac2 = snd_pcm_substream_chip(substream); uac2_pcm_pointer()
313 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) uac2_pcm_pointer()
318 return bytes_to_frames(substream->runtime, prm->hw_ptr); uac2_pcm_pointer()
321 static int uac2_pcm_hw_params(struct snd_pcm_substream *substream, uac2_pcm_hw_params() argument
324 struct snd_uac2_chip *uac2 = snd_pcm_substream_chip(substream); uac2_pcm_hw_params()
328 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) uac2_pcm_hw_params()
333 err = snd_pcm_lib_malloc_pages(substream, uac2_pcm_hw_params()
336 prm->dma_bytes = substream->runtime->dma_bytes; uac2_pcm_hw_params()
337 prm->dma_area = substream->runtime->dma_area; uac2_pcm_hw_params()
344 static int uac2_pcm_hw_free(struct snd_pcm_substream *substream) uac2_pcm_hw_free() argument
346 struct snd_uac2_chip *uac2 = snd_pcm_substream_chip(substream); uac2_pcm_hw_free()
349 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) uac2_pcm_hw_free()
358 return snd_pcm_lib_free_pages(substream); uac2_pcm_hw_free()
361 static int uac2_pcm_open(struct snd_pcm_substream *substream) uac2_pcm_open() argument
363 struct snd_uac2_chip *uac2 = snd_pcm_substream_chip(substream); uac2_pcm_open()
364 struct snd_pcm_runtime *runtime = substream->runtime; uac2_pcm_open()
383 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { uac2_pcm_open()
428 static int uac2_pcm_null(struct snd_pcm_substream *substream) uac2_pcm_null() argument
468 * Create a substream only for non-zero channel streams snd_uac2_probe()
H A Df_midi.c221 struct snd_rawmidi_substream *substream = midi->out_substream[cable]; f_midi_read_data() local
223 if (!substream) f_midi_read_data()
230 snd_rawmidi_receive(substream, data, length); f_midi_read_data()
531 struct snd_rawmidi_substream *substream = midi->in_substream[i]; f_midi_transmit() local
533 if (!port || !port->active || !substream) f_midi_transmit()
538 if (snd_rawmidi_transmit(substream, &b, 1) != 1) { f_midi_transmit()
558 static int f_midi_in_open(struct snd_rawmidi_substream *substream) f_midi_in_open() argument
560 struct f_midi *midi = substream->rmidi->private_data; f_midi_in_open()
562 if (!midi->in_port[substream->number]) f_midi_in_open()
566 midi->in_substream[substream->number] = substream; f_midi_in_open()
567 midi->in_port[substream->number]->state = STATE_UNKNOWN; f_midi_in_open()
571 static int f_midi_in_close(struct snd_rawmidi_substream *substream) f_midi_in_close() argument
573 struct f_midi *midi = substream->rmidi->private_data; f_midi_in_close()
579 static void f_midi_in_trigger(struct snd_rawmidi_substream *substream, int up) f_midi_in_trigger() argument
581 struct f_midi *midi = substream->rmidi->private_data; f_midi_in_trigger()
583 if (!midi->in_port[substream->number]) f_midi_in_trigger()
587 midi->in_port[substream->number]->active = up; f_midi_in_trigger()
592 static int f_midi_out_open(struct snd_rawmidi_substream *substream) f_midi_out_open() argument
594 struct f_midi *midi = substream->rmidi->private_data; f_midi_out_open()
596 if (substream->number >= MAX_PORTS) f_midi_out_open()
600 midi->out_substream[substream->number] = substream; f_midi_out_open()
604 static int f_midi_out_close(struct snd_rawmidi_substream *substream) f_midi_out_close() argument
606 struct f_midi *midi = substream->rmidi->private_data; f_midi_out_close()
612 static void f_midi_out_trigger(struct snd_rawmidi_substream *substream, int up) f_midi_out_trigger() argument
614 struct f_midi *midi = substream->rmidi->private_data; f_midi_out_trigger()
619 set_bit(substream->number, &midi->out_triggered); f_midi_out_trigger()
621 clear_bit(substream->number, &midi->out_triggered); f_midi_out_trigger()
/linux-4.1.27/sound/pci/aw2/
H A Daw2-alsa.c121 static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream);
122 static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream);
123 static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream);
124 static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream);
125 static int snd_aw2_pcm_hw_params(struct snd_pcm_substream *substream,
127 static int snd_aw2_pcm_hw_free(struct snd_pcm_substream *substream);
128 static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream);
129 static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream);
130 static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream,
132 static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream,
135 *substream);
137 *substream);
395 static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream) snd_aw2_pcm_playback_open() argument
397 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_playback_open()
399 dev_dbg(substream->pcm->card->dev, "Playback_open\n"); snd_aw2_pcm_playback_open()
405 static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream) snd_aw2_pcm_playback_close() argument
411 static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream) snd_aw2_pcm_capture_open() argument
413 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_capture_open()
415 dev_dbg(substream->pcm->card->dev, "Capture_open\n"); snd_aw2_pcm_capture_open()
421 static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream) snd_aw2_pcm_capture_close() argument
428 static int snd_aw2_pcm_hw_params(struct snd_pcm_substream *substream, snd_aw2_pcm_hw_params() argument
431 return snd_pcm_lib_malloc_pages(substream, snd_aw2_pcm_hw_params()
436 static int snd_aw2_pcm_hw_free(struct snd_pcm_substream *substream) snd_aw2_pcm_hw_free() argument
438 return snd_pcm_lib_free_pages(substream); snd_aw2_pcm_hw_free()
442 static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream) snd_aw2_pcm_prepare_playback() argument
444 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_prepare_playback()
446 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_prepare_playback()
451 period_size = snd_pcm_lib_period_bytes(substream); snd_aw2_pcm_prepare_playback()
452 buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_aw2_pcm_prepare_playback()
463 (void *)substream); snd_aw2_pcm_prepare_playback()
471 static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream) snd_aw2_pcm_prepare_capture() argument
473 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_prepare_capture()
475 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_prepare_capture()
480 period_size = snd_pcm_lib_period_bytes(substream); snd_aw2_pcm_prepare_capture()
481 buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_aw2_pcm_prepare_capture()
492 (void *)substream); snd_aw2_pcm_prepare_capture()
500 static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream, snd_aw2_pcm_trigger_playback() argument
504 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_trigger_playback()
526 static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream, snd_aw2_pcm_trigger_capture() argument
530 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_trigger_capture()
553 *substream) snd_aw2_pcm_pointer_playback()
555 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_pointer_playback()
560 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_pointer_playback()
567 return bytes_to_frames(substream->runtime, current_ptr); snd_aw2_pcm_pointer_playback()
572 *substream) snd_aw2_pcm_pointer_capture()
574 struct aw2_pcm_device *pcm_device = snd_pcm_substream_chip(substream); snd_aw2_pcm_pointer_capture()
579 struct snd_pcm_runtime *runtime = substream->runtime; snd_aw2_pcm_pointer_capture()
586 return bytes_to_frames(substream->runtime, current_ptr); snd_aw2_pcm_pointer_capture()
552 snd_aw2_pcm_pointer_playback(struct snd_pcm_substream *substream) snd_aw2_pcm_pointer_playback() argument
571 snd_aw2_pcm_pointer_capture(struct snd_pcm_substream *substream) snd_aw2_pcm_pointer_capture() argument
/linux-4.1.27/sound/soc/davinci/
H A Ddavinci-vcif.c55 static void davinci_vcif_start(struct snd_pcm_substream *substream) davinci_vcif_start() argument
57 struct snd_soc_pcm_runtime *rtd = substream->private_data; davinci_vcif_start()
66 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) davinci_vcif_start()
74 static void davinci_vcif_stop(struct snd_pcm_substream *substream) davinci_vcif_stop() argument
76 struct snd_soc_pcm_runtime *rtd = substream->private_data; davinci_vcif_stop()
84 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) davinci_vcif_stop()
92 static int davinci_vcif_hw_params(struct snd_pcm_substream *substream, davinci_vcif_hw_params() argument
101 davinci_vcif_stop(substream); davinci_vcif_hw_params()
102 davinci_vcif_start(substream); davinci_vcif_hw_params()
144 static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd, davinci_vcif_trigger() argument
153 davinci_vcif_start(substream); davinci_vcif_trigger()
158 davinci_vcif_stop(substream); davinci_vcif_trigger()
/linux-4.1.27/sound/pci/trident/
H A Dtrident_main.c50 struct snd_pcm_substream *substream);
53 struct snd_pcm_substream *substream);
757 substream - PCM substream
762 static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream) snd_trident_control_mode() argument
765 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_control_mode()
789 Parameters: substream - PCM substream class
797 static int snd_trident_ioctl(struct snd_pcm_substream *substream, snd_trident_ioctl() argument
804 return snd_pcm_lib_ioctl(substream, cmd, arg); snd_trident_ioctl()
810 Description: Allocate PCM ring buffer for given substream
812 Parameters: substream - PCM substream class
819 static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream, snd_trident_allocate_pcm_mem() argument
822 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_allocate_pcm_mem()
823 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_allocate_pcm_mem()
827 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_trident_allocate_pcm_mem()
833 voice->memblk = snd_trident_alloc_pages(trident, substream); snd_trident_allocate_pcm_mem()
846 Parameters: substream - PCM substream class
853 static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream, snd_trident_allocate_evoice() argument
856 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_allocate_evoice()
857 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_allocate_evoice()
869 evoice->substream = substream; snd_trident_allocate_evoice()
886 Parameters: substream - PCM substream class
893 static int snd_trident_hw_params(struct snd_pcm_substream *substream, snd_trident_hw_params() argument
898 err = snd_trident_allocate_pcm_mem(substream, hw_params); snd_trident_hw_params()
900 err = snd_trident_allocate_evoice(substream, hw_params); snd_trident_hw_params()
909 Parameters: substream - PCM substream class
915 static int snd_trident_hw_free(struct snd_pcm_substream *substream) snd_trident_hw_free() argument
917 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_hw_free()
918 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_hw_free()
928 snd_pcm_lib_free_pages(substream); snd_trident_hw_free()
941 Parameters: substream - PCM substream class
947 static int snd_trident_playback_prepare(struct snd_pcm_substream *substream) snd_trident_playback_prepare() argument
949 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_prepare()
950 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_prepare()
953 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number]; snd_trident_playback_prepare()
969 voice->CTRL = snd_trident_control_mode(substream); snd_trident_playback_prepare()
1026 Parameters: substream - PCM substream class
1033 static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream, snd_trident_capture_hw_params() argument
1036 return snd_trident_allocate_pcm_mem(substream, hw_params); snd_trident_capture_hw_params()
1044 Parameters: substream - PCM substream class
1050 static int snd_trident_capture_prepare(struct snd_pcm_substream *substream) snd_trident_capture_prepare() argument
1052 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_prepare()
1053 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_prepare()
1072 ESO_bytes = snd_pcm_lib_buffer_bytes(substream) - 1; snd_trident_capture_prepare()
1112 voice->CTRL = snd_trident_control_mode(substream); snd_trident_capture_prepare()
1135 Parameters: substream - PCM substream class
1142 static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream, snd_trident_si7018_capture_hw_params() argument
1147 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_trident_si7018_capture_hw_params()
1150 return snd_trident_allocate_evoice(substream, hw_params); snd_trident_si7018_capture_hw_params()
1158 Parameters: substream - PCM substream class
1164 static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substream) snd_trident_si7018_capture_hw_free() argument
1166 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_si7018_capture_hw_free()
1167 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_si7018_capture_hw_free()
1171 snd_pcm_lib_free_pages(substream); snd_trident_si7018_capture_hw_free()
1184 Parameters: substream - PCM substream class
1190 static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substream) snd_trident_si7018_capture_prepare() argument
1192 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_si7018_capture_prepare()
1193 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_si7018_capture_prepare()
1206 voice->CTRL = snd_trident_control_mode(substream); snd_trident_si7018_capture_prepare()
1255 Parameters: substream - PCM substream class
1261 static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream) snd_trident_foldback_prepare() argument
1263 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_prepare()
1264 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_prepare()
1284 voice->CTRL = snd_trident_control_mode(substream); snd_trident_foldback_prepare()
1332 Parameters: substream - PCM substream class
1339 static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream, snd_trident_spdif_hw_params() argument
1342 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_hw_params()
1346 err = snd_trident_allocate_pcm_mem(substream, hw_params); snd_trident_spdif_hw_params()
1351 err = snd_trident_allocate_evoice(substream, hw_params); snd_trident_spdif_hw_params()
1398 Parameters: substream - PCM substream class
1404 static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream) snd_trident_spdif_prepare() argument
1406 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_prepare()
1407 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_prepare()
1410 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number]; snd_trident_spdif_prepare()
1439 voice->CTRL = snd_trident_control_mode(substream); snd_trident_spdif_prepare()
1480 voice->CTRL = snd_trident_control_mode(substream); snd_trident_spdif_prepare()
1536 Parameters: substream - PCM substream class
1543 static int snd_trident_trigger(struct snd_pcm_substream *substream, snd_trident_trigger() argument
1547 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_trigger()
1570 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1589 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1636 Parameters: substream - PCM substream class
1642 static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *substream) snd_trident_playback_pointer() argument
1644 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_pointer()
1645 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_pointer()
1681 static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *substream) snd_trident_capture_pointer() argument
1683 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_pointer()
1684 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_pointer()
1705 Parameters: substream - PCM substream class
1711 static snd_pcm_uframes_t snd_trident_spdif_pointer(struct snd_pcm_substream *substream) snd_trident_spdif_pointer() argument
1713 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_pointer()
1714 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_pointer()
1856 static int snd_trident_playback_open(struct snd_pcm_substream *substream) snd_trident_playback_open() argument
1858 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_open()
1859 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_open()
1865 snd_trident_pcm_mixer_build(trident, voice, substream); snd_trident_playback_open()
1866 voice->substream = substream; snd_trident_playback_open()
1870 snd_pcm_set_sync(substream); snd_trident_playback_open()
1881 Parameters: substream - PCM substream class
1884 static int snd_trident_playback_close(struct snd_pcm_substream *substream) snd_trident_playback_close() argument
1886 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_close()
1887 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_playback_close()
1890 snd_trident_pcm_mixer_free(trident, voice, substream); snd_trident_playback_close()
1899 Parameters: substream - PCM substream class
1905 static int snd_trident_spdif_open(struct snd_pcm_substream *substream) snd_trident_spdif_open() argument
1907 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_open()
1909 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_spdif_open()
1915 voice->substream = substream; snd_trident_spdif_open()
1942 Parameters: substream - PCM substream class
1946 static int snd_trident_spdif_close(struct snd_pcm_substream *substream) snd_trident_spdif_close() argument
1948 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_close()
1978 Parameters: substream - PCM substream class
1984 static int snd_trident_capture_open(struct snd_pcm_substream *substream) snd_trident_capture_open() argument
1986 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_open()
1988 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_capture_open()
1994 voice->substream = substream; snd_trident_capture_open()
1998 snd_pcm_set_sync(substream); snd_trident_capture_open()
2009 Parameters: substream - PCM substream class
2012 static int snd_trident_capture_close(struct snd_pcm_substream *substream) snd_trident_capture_close() argument
2022 Parameters: substream - PCM substream class
2028 static int snd_trident_foldback_open(struct snd_pcm_substream *substream) snd_trident_foldback_open() argument
2030 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_open()
2032 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_open()
2037 voice->foldback_chan = substream->number; snd_trident_foldback_open()
2038 voice->substream = substream; snd_trident_foldback_open()
2052 Parameters: substream - PCM substream class
2055 static int snd_trident_foldback_close(struct snd_pcm_substream *substream) snd_trident_foldback_close() argument
2057 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_close()
2059 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_foldback_close()
2200 struct snd_pcm_substream *substream; snd_trident_pcm() local
2201 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) snd_trident_pcm()
2202 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_trident_pcm()
2205 snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, snd_trident_pcm()
2232 struct snd_pcm_substream *substream; snd_trident_foldback_pcm() local
2246 substream = foldback->streams[SNDRV_PCM_STREAM_CAPTURE].substream; snd_trident_foldback_pcm()
2247 strcpy(substream->name, "Front Mixer"); snd_trident_foldback_pcm()
2248 substream = substream->next; snd_trident_foldback_pcm()
2249 strcpy(substream->name, "Reverb Mixer"); snd_trident_foldback_pcm()
2250 substream = substream->next; snd_trident_foldback_pcm()
2251 strcpy(substream->name, "Chorus Mixer"); snd_trident_foldback_pcm()
2253 substream = substream->next; snd_trident_foldback_pcm()
2254 strcpy(substream->name, "Second AC'97 ADC"); snd_trident_foldback_pcm()
2921 struct snd_pcm_substream *substream) snd_trident_pcm_mixer_build()
2925 if (snd_BUG_ON(!trident || !voice || !substream)) snd_trident_pcm_mixer_build()
2927 tmix = &trident->pcm_mixer[substream->number]; snd_trident_pcm_mixer_build()
2933 snd_trident_notify_pcm_change(trident, tmix, substream->number, 1); snd_trident_pcm_mixer_build()
2937 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice, struct snd_pcm_substream *substream) snd_trident_pcm_mixer_free() argument
2941 if (snd_BUG_ON(!trident || !substream)) snd_trident_pcm_mixer_free()
2943 tmix = &trident->pcm_mixer[substream->number]; snd_trident_pcm_mixer_free()
2945 snd_trident_notify_pcm_change(trident, tmix, substream->number, 0); snd_trident_pcm_mixer_free()
3746 if (!voice->pcm || voice->substream == NULL) { snd_trident_interrupt()
3798 snd_pcm_period_elapsed(voice->substream); snd_trident_interrupt()
3835 pvoice->substream = NULL; snd_trident_alloc_voice()
3881 voice->substream = NULL; snd_trident_free_voice()
2919 snd_trident_pcm_mixer_build(struct snd_trident *trident, struct snd_trident_voice *voice, struct snd_pcm_substream *substream) snd_trident_pcm_mixer_build() argument
H A Dtrident_memory.c190 struct snd_pcm_substream *substream) snd_trident_alloc_sg_pages()
194 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_alloc_sg_pages()
218 dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs); snd_trident_alloc_sg_pages()
220 snd_pcm_sgbuf_get_ptr(substream, ofs); snd_trident_alloc_sg_pages()
237 struct snd_pcm_substream *substream) snd_trident_alloc_cont_pages()
242 struct snd_pcm_runtime *runtime = substream->runtime; snd_trident_alloc_cont_pages()
282 struct snd_pcm_substream *substream) snd_trident_alloc_pages()
284 if (snd_BUG_ON(!trident || !substream)) snd_trident_alloc_pages()
286 if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV_SG) snd_trident_alloc_pages()
287 return snd_trident_alloc_sg_pages(trident, substream); snd_trident_alloc_pages()
289 return snd_trident_alloc_cont_pages(trident, substream); snd_trident_alloc_pages()
189 snd_trident_alloc_sg_pages(struct snd_trident *trident, struct snd_pcm_substream *substream) snd_trident_alloc_sg_pages() argument
236 snd_trident_alloc_cont_pages(struct snd_trident *trident, struct snd_pcm_substream *substream) snd_trident_alloc_cont_pages() argument
281 snd_trident_alloc_pages(struct snd_trident *trident, struct snd_pcm_substream *substream) snd_trident_alloc_pages() argument
/linux-4.1.27/sound/isa/gus/
H A Dgus_pcm.c46 struct snd_pcm_substream *substream; member in struct:gus_pcm_private
74 static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream, snd_gf1_pcm_block_change() argument
80 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_block_change()
106 static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream) snd_gf1_pcm_trigger_up() argument
108 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_trigger_up()
207 runtime = pcmp->substream->runtime; snd_gf1_pcm_interrupt_wave()
256 snd_pcm_period_elapsed(pcmp->substream); snd_gf1_pcm_interrupt_wave()
262 snd_gf1_pcm_block_change(pcmp->substream, end, pcmp->memory + (end / 2), pcmp->block_size / 2); snd_gf1_pcm_interrupt_wave()
263 snd_gf1_pcm_block_change(pcmp->substream, end + (pcmp->block_size / 2), pcmp->memory + (pcmp->dma_size / 2) + (end / 2), pcmp->block_size / 2); snd_gf1_pcm_interrupt_wave()
265 snd_gf1_pcm_block_change(pcmp->substream, end, pcmp->memory + end, pcmp->block_size); snd_gf1_pcm_interrupt_wave()
290 if (pcmp->substream == NULL) snd_gf1_pcm_interrupt_volume()
356 static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, snd_gf1_pcm_playback_copy() argument
362 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_copy()
375 return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); snd_gf1_pcm_playback_copy()
388 static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, snd_gf1_pcm_playback_silence() argument
393 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_silence()
405 return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); snd_gf1_pcm_playback_silence()
418 static int snd_gf1_pcm_playback_hw_params(struct snd_pcm_substream *substream, snd_gf1_pcm_playback_hw_params() argument
421 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_playback_hw_params()
422 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_hw_params()
426 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_gf1_pcm_playback_hw_params()
467 static int snd_gf1_pcm_playback_hw_free(struct snd_pcm_substream *substream) snd_gf1_pcm_playback_hw_free() argument
469 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_hw_free()
472 snd_pcm_lib_free_pages(substream); snd_gf1_pcm_playback_hw_free()
488 static int snd_gf1_pcm_playback_prepare(struct snd_pcm_substream *substream) snd_gf1_pcm_playback_prepare() argument
490 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_prepare()
494 pcmp->dma_size = snd_pcm_lib_buffer_bytes(substream); snd_gf1_pcm_playback_prepare()
495 pcmp->block_size = snd_pcm_lib_period_bytes(substream); snd_gf1_pcm_playback_prepare()
500 static int snd_gf1_pcm_playback_trigger(struct snd_pcm_substream *substream, snd_gf1_pcm_playback_trigger() argument
503 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_playback_trigger()
504 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_trigger()
509 snd_gf1_pcm_trigger_up(substream); snd_gf1_pcm_playback_trigger()
526 static snd_pcm_uframes_t snd_gf1_pcm_playback_pointer(struct snd_pcm_substream *substream) snd_gf1_pcm_playback_pointer() argument
528 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_playback_pointer()
529 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_pointer()
540 if (substream->runtime->channels > 1) snd_gf1_pcm_playback_pointer()
560 static int snd_gf1_pcm_capture_hw_params(struct snd_pcm_substream *substream, snd_gf1_pcm_capture_hw_params() argument
563 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_hw_params()
575 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_gf1_pcm_capture_hw_params()
578 static int snd_gf1_pcm_capture_hw_free(struct snd_pcm_substream *substream) snd_gf1_pcm_capture_hw_free() argument
580 return snd_pcm_lib_free_pages(substream); snd_gf1_pcm_capture_hw_free()
583 static int snd_gf1_pcm_capture_prepare(struct snd_pcm_substream *substream) snd_gf1_pcm_capture_prepare() argument
585 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_prepare()
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_capture_prepare()
595 static int snd_gf1_pcm_capture_trigger(struct snd_pcm_substream *substream, snd_gf1_pcm_capture_trigger() argument
598 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_trigger()
616 static snd_pcm_uframes_t snd_gf1_pcm_capture_pointer(struct snd_pcm_substream *substream) snd_gf1_pcm_capture_pointer() argument
618 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_pointer()
620 pos = bytes_to_frames(substream->runtime, (gus->c_pos + pos) % gus->c_dma_size); snd_gf1_pcm_capture_pointer()
677 static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream) snd_gf1_pcm_playback_open() argument
680 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_playback_open()
681 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_open()
702 pcmp->substream = substream; snd_gf1_pcm_playback_open()
710 static int snd_gf1_pcm_playback_close(struct snd_pcm_substream *substream) snd_gf1_pcm_playback_close() argument
712 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_playback_close()
713 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_playback_close()
723 static int snd_gf1_pcm_capture_open(struct snd_pcm_substream *substream) snd_gf1_pcm_capture_open() argument
725 struct snd_pcm_runtime *runtime = substream->runtime; snd_gf1_pcm_capture_open()
726 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_open()
729 gus->pcm_cap_substream = substream; snd_gf1_pcm_capture_open()
730 substream->runtime->hw = snd_gf1_pcm_capture; snd_gf1_pcm_capture_open()
738 static int snd_gf1_pcm_capture_close(struct snd_pcm_substream *substream) snd_gf1_pcm_capture_close() argument
740 struct snd_gus_card *gus = snd_pcm_substream_chip(substream); snd_gf1_pcm_capture_close()
857 struct snd_pcm_substream *substream; snd_gf1_pcm_new() local
874 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) snd_gf1_pcm_new()
875 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, snd_gf1_pcm_new()
885 snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, snd_gf1_pcm_new()
H A Dgus_uart.c92 static int snd_gf1_uart_output_open(struct snd_rawmidi_substream *substream) snd_gf1_uart_output_open() argument
97 gus = substream->rmidi->private_data; snd_gf1_uart_output_open()
103 gus->midi_substream_output = substream; snd_gf1_uart_output_open()
111 static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream) snd_gf1_uart_input_open() argument
117 gus = substream->rmidi->private_data; snd_gf1_uart_input_open()
123 gus->midi_substream_input = substream; snd_gf1_uart_input_open()
144 static int snd_gf1_uart_output_close(struct snd_rawmidi_substream *substream) snd_gf1_uart_output_close() argument
149 gus = substream->rmidi->private_data; snd_gf1_uart_output_close()
159 static int snd_gf1_uart_input_close(struct snd_rawmidi_substream *substream) snd_gf1_uart_input_close() argument
164 gus = substream->rmidi->private_data; snd_gf1_uart_input_close()
174 static void snd_gf1_uart_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_gf1_uart_input_trigger() argument
179 gus = substream->rmidi->private_data; snd_gf1_uart_input_trigger()
192 static void snd_gf1_uart_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_gf1_uart_output_trigger() argument
199 gus = substream->rmidi->private_data; snd_gf1_uart_output_trigger()
215 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_gf1_uart_output_trigger()
/linux-4.1.27/sound/aoa/soundbus/i2sbus/
H A Dpcm.c91 hw = &pi->substream->runtime->hw; i2sbus_pcm_open()
196 err = snd_pcm_hw_constraint_integer(pi->substream->runtime, i2sbus_pcm_open()
204 err = cii->codec->open(cii, pi->substream); i2sbus_pcm_open()
213 pi->substream); i2sbus_pcm_open()
242 tmp = cii->codec->close(cii, pi->substream); i2sbus_pcm_close()
248 pi->substream = NULL; i2sbus_pcm_close()
298 static int i2sbus_hw_params(struct snd_pcm_substream *substream, i2sbus_hw_params() argument
301 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); i2sbus_hw_params()
304 static inline int i2sbus_hw_free(struct snd_pcm_substream *substream, int in) i2sbus_hw_free() argument
306 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_hw_free()
312 snd_pcm_lib_free_pages(substream); i2sbus_hw_free()
316 static int i2sbus_playback_hw_free(struct snd_pcm_substream *substream) i2sbus_playback_hw_free() argument
318 return i2sbus_hw_free(substream, 0); i2sbus_playback_hw_free()
321 static int i2sbus_record_hw_free(struct snd_pcm_substream *substream) i2sbus_record_hw_free() argument
323 return i2sbus_hw_free(substream, 1); i2sbus_record_hw_free()
356 if (!pi->substream || !pi->substream->runtime) { i2sbus_pcm_prepare()
361 runtime = pi->substream->runtime; i2sbus_pcm_prepare()
373 periodsize = snd_pcm_lib_period_bytes(pi->substream); i2sbus_pcm_prepare()
374 nperiods = pi->substream->runtime->periods; i2sbus_pcm_prepare()
468 err = cii->codec->prepare(cii, &bi, pi->substream); i2sbus_pcm_prepare()
559 cii->codec->start(cii, pi->substream); i2sbus_pcm_trigger()
608 cii->codec->stop(cii, pi->substream); i2sbus_pcm_trigger()
630 if (fc >= pi->substream->runtime->buffer_size) i2sbus_pcm_pointer()
631 fc %= pi->substream->runtime->buffer_size; i2sbus_pcm_pointer()
650 runtime = pi->substream->runtime; handle_interrupt()
703 snd_pcm_period_elapsed(pi->substream); handle_interrupt()
722 static int i2sbus_playback_open(struct snd_pcm_substream *substream) i2sbus_playback_open() argument
724 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_playback_open()
728 i2sdev->out.substream = substream; i2sbus_playback_open()
732 static int i2sbus_playback_close(struct snd_pcm_substream *substream) i2sbus_playback_close() argument
734 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_playback_close()
739 if (i2sdev->out.substream != substream) i2sbus_playback_close()
743 i2sdev->out.substream = NULL; i2sbus_playback_close()
747 static int i2sbus_playback_prepare(struct snd_pcm_substream *substream) i2sbus_playback_prepare() argument
749 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_playback_prepare()
753 if (i2sdev->out.substream != substream) i2sbus_playback_prepare()
758 static int i2sbus_playback_trigger(struct snd_pcm_substream *substream, int cmd) i2sbus_playback_trigger() argument
760 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_playback_trigger()
764 if (i2sdev->out.substream != substream) i2sbus_playback_trigger()
770 *substream) i2sbus_playback_pointer()
772 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_playback_pointer()
776 if (i2sdev->out.substream != substream) i2sbus_playback_pointer()
792 static int i2sbus_record_open(struct snd_pcm_substream *substream) i2sbus_record_open() argument
794 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_record_open()
798 i2sdev->in.substream = substream; i2sbus_record_open()
802 static int i2sbus_record_close(struct snd_pcm_substream *substream) i2sbus_record_close() argument
804 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_record_close()
809 if (i2sdev->in.substream != substream) i2sbus_record_close()
813 i2sdev->in.substream = NULL; i2sbus_record_close()
817 static int i2sbus_record_prepare(struct snd_pcm_substream *substream) i2sbus_record_prepare() argument
819 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_record_prepare()
823 if (i2sdev->in.substream != substream) i2sbus_record_prepare()
828 static int i2sbus_record_trigger(struct snd_pcm_substream *substream, int cmd) i2sbus_record_trigger() argument
830 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_record_trigger()
834 if (i2sdev->in.substream != substream) i2sbus_record_trigger()
840 *substream) i2sbus_record_pointer()
842 struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream); i2sbus_record_pointer()
846 if (i2sdev->in.substream != substream) i2sbus_record_pointer()
1012 /* so we have to register the pcm after adding any substream i2sbus_attach_codec()
769 i2sbus_playback_pointer(struct snd_pcm_substream *substream) i2sbus_playback_pointer() argument
839 i2sbus_record_pointer(struct snd_pcm_substream *substream) i2sbus_record_pointer() argument
/linux-4.1.27/sound/pci/ice1712/
H A Dice1724.c319 static void vt1724_enable_midi_irq(struct snd_rawmidi_substream *substream, vt1724_enable_midi_irq() argument
322 struct snd_ice1712 *ice = substream->rmidi->private_data; vt1724_enable_midi_irq()
555 static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_vt1724_pcm_trigger() argument
557 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_pcm_trigger()
563 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
568 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
719 static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, snd_vt1724_pcm_hw_params() argument
722 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_pcm_hw_params()
728 if (substream == ice->playback_pro_substream) { snd_vt1724_pcm_hw_params()
733 ice->pcm_reserved[i] != substream) { snd_vt1724_pcm_hw_params()
737 ice->pcm_reserved[i] = substream; snd_vt1724_pcm_hw_params()
740 if (ice->pcm_reserved[i] == substream) snd_vt1724_pcm_hw_params()
746 if (ice->playback_con_substream_ds[i] == substream) { snd_vt1724_pcm_hw_params()
748 ice->pcm_reserved[i] != substream) { snd_vt1724_pcm_hw_params()
752 ice->pcm_reserved[i] = substream; snd_vt1724_pcm_hw_params()
763 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_vt1724_pcm_hw_params()
766 static int snd_vt1724_pcm_hw_free(struct snd_pcm_substream *substream) snd_vt1724_pcm_hw_free() argument
768 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_pcm_hw_free()
774 if (ice->pcm_reserved[i] == substream) snd_vt1724_pcm_hw_free()
777 return snd_pcm_lib_free_pages(substream); snd_vt1724_pcm_hw_free()
780 static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream) snd_vt1724_playback_pro_prepare() argument
782 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_pro_prepare()
787 val = (8 - substream->runtime->channels) >> 1; snd_vt1724_playback_pro_prepare()
790 outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR)); snd_vt1724_playback_pro_prepare()
792 size = (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1; snd_vt1724_playback_pro_prepare()
796 size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; snd_vt1724_playback_pro_prepare()
806 substream->runtime->channels, snd_vt1724_playback_pro_prepare()
807 (unsigned int)substream->runtime->dma_addr, snd_vt1724_playback_pro_prepare()
808 snd_pcm_lib_buffer_bytes(substream), snd_vt1724_playback_pro_prepare()
809 snd_pcm_lib_period_bytes(substream)); snd_vt1724_playback_pro_prepare()
814 static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substream *substream) snd_vt1724_playback_pro_pointer() argument
816 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_pro_pointer()
823 if (ptr < substream->runtime->dma_addr) { snd_vt1724_playback_pro_pointer()
827 ptr -= substream->runtime->dma_addr; snd_vt1724_playback_pro_pointer()
828 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_playback_pro_pointer()
829 if (ptr >= substream->runtime->buffer_size) { snd_vt1724_playback_pro_pointer()
831 (int)ptr, (int)substream->runtime->period_size); snd_vt1724_playback_pro_pointer()
837 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_playback_pro_pointer()
840 else if (ptr <= substream->runtime->buffer_size) snd_vt1724_playback_pro_pointer()
841 ptr = substream->runtime->buffer_size - ptr; snd_vt1724_playback_pro_pointer()
844 (int)ptr, (int)substream->runtime->buffer_size); snd_vt1724_playback_pro_pointer()
851 static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) snd_vt1724_pcm_prepare() argument
853 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_pcm_prepare()
854 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; snd_vt1724_pcm_prepare()
857 outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); snd_vt1724_pcm_prepare()
858 outw((snd_pcm_lib_buffer_bytes(substream) >> 2) - 1, snd_vt1724_pcm_prepare()
860 outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, snd_vt1724_pcm_prepare()
866 static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substream) snd_vt1724_pcm_pointer() argument
868 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_pcm_pointer()
869 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; snd_vt1724_pcm_pointer()
876 ptr -= substream->runtime->dma_addr; snd_vt1724_pcm_pointer()
877 return bytes_to_frames(substream->runtime, ptr); snd_vt1724_pcm_pointer()
881 ptr = bytes_to_frames(substream->runtime, ptr); snd_vt1724_pcm_pointer()
884 else if (ptr <= substream->runtime->buffer_size) snd_vt1724_pcm_pointer()
885 ptr = substream->runtime->buffer_size - ptr; snd_vt1724_pcm_pointer()
888 (int)ptr, (int)substream->runtime->buffer_size); snd_vt1724_pcm_pointer()
1004 struct snd_pcm_substream *substream) set_rate_constraints()
1006 struct snd_pcm_runtime *runtime = substream->runtime; set_rate_constraints()
1019 static void constrain_rate_if_locked(struct snd_pcm_substream *substream) constrain_rate_if_locked() argument
1021 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); constrain_rate_if_locked()
1022 struct snd_pcm_runtime *runtime = substream->runtime; constrain_rate_if_locked()
1040 static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream) snd_vt1724_playback_pro_open() argument
1042 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_pro_open()
1043 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_pro_open()
1047 ice->playback_pro_substream = substream; snd_vt1724_playback_pro_open()
1049 snd_pcm_set_sync(substream); snd_vt1724_playback_pro_open()
1051 set_rate_constraints(ice, substream); snd_vt1724_playback_pro_open()
1068 constrain_rate_if_locked(substream); snd_vt1724_playback_pro_open()
1070 ice->pro_open(ice, substream); snd_vt1724_playback_pro_open()
1074 static int snd_vt1724_capture_pro_open(struct snd_pcm_substream *substream) snd_vt1724_capture_pro_open() argument
1076 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_capture_pro_open()
1077 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_capture_pro_open()
1080 ice->capture_pro_substream = substream; snd_vt1724_capture_pro_open()
1082 snd_pcm_set_sync(substream); snd_vt1724_capture_pro_open()
1084 set_rate_constraints(ice, substream); snd_vt1724_capture_pro_open()
1089 constrain_rate_if_locked(substream); snd_vt1724_capture_pro_open()
1091 ice->pro_open(ice, substream); snd_vt1724_capture_pro_open()
1095 static int snd_vt1724_playback_pro_close(struct snd_pcm_substream *substream) snd_vt1724_playback_pro_close() argument
1097 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_pro_close()
1106 static int snd_vt1724_capture_pro_close(struct snd_pcm_substream *substream) snd_vt1724_capture_pro_close() argument
1108 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_capture_pro_close()
1213 static int snd_vt1724_playback_spdif_prepare(struct snd_pcm_substream *substream) snd_vt1724_playback_spdif_prepare() argument
1215 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_spdif_prepare()
1217 update_spdif_rate(ice, substream->runtime->rate); snd_vt1724_playback_spdif_prepare()
1218 return snd_vt1724_pcm_prepare(substream); snd_vt1724_playback_spdif_prepare()
1221 static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream) snd_vt1724_playback_spdif_open() argument
1223 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_spdif_open()
1224 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_spdif_open()
1227 ice->playback_con_substream = substream; snd_vt1724_playback_spdif_open()
1230 set_rate_constraints(ice, substream); snd_vt1724_playback_spdif_open()
1233 snd_pcm_set_sync(substream); snd_vt1724_playback_spdif_open()
1239 constrain_rate_if_locked(substream); snd_vt1724_playback_spdif_open()
1241 ice->spdif.ops.open(ice, substream); snd_vt1724_playback_spdif_open()
1245 static int snd_vt1724_playback_spdif_close(struct snd_pcm_substream *substream) snd_vt1724_playback_spdif_close() argument
1247 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_spdif_close()
1253 ice->spdif.ops.close(ice, substream); snd_vt1724_playback_spdif_close()
1258 static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream) snd_vt1724_capture_spdif_open() argument
1260 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_capture_spdif_open()
1261 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_capture_spdif_open()
1264 ice->capture_con_substream = substream; snd_vt1724_capture_spdif_open()
1267 set_rate_constraints(ice, substream); snd_vt1724_capture_spdif_open()
1270 snd_pcm_set_sync(substream); snd_vt1724_capture_spdif_open()
1276 constrain_rate_if_locked(substream); snd_vt1724_capture_spdif_open()
1278 ice->spdif.ops.open(ice, substream); snd_vt1724_capture_spdif_open()
1282 static int snd_vt1724_capture_spdif_close(struct snd_pcm_substream *substream) snd_vt1724_capture_spdif_close() argument
1284 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_capture_spdif_close()
1290 ice->spdif.ops.close(ice, substream); snd_vt1724_capture_spdif_close()
1394 static int snd_vt1724_playback_indep_prepare(struct snd_pcm_substream *substream) snd_vt1724_playback_indep_prepare() argument
1396 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_indep_prepare()
1400 val = 3 - substream->number; snd_vt1724_playback_indep_prepare()
1404 return snd_vt1724_pcm_prepare(substream); snd_vt1724_playback_indep_prepare()
1407 static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream) snd_vt1724_playback_indep_open() argument
1409 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_indep_open()
1410 struct snd_pcm_runtime *runtime = substream->runtime; snd_vt1724_playback_indep_open()
1414 if (ice->pcm_reserved[substream->number]) { snd_vt1724_playback_indep_open()
1419 runtime->private_data = (void *)&vt1724_playback_dma_regs[substream->number]; snd_vt1724_playback_indep_open()
1420 ice->playback_con_substream_ds[substream->number] = substream; snd_vt1724_playback_indep_open()
1422 snd_pcm_set_sync(substream); snd_vt1724_playback_indep_open()
1424 set_rate_constraints(ice, substream); snd_vt1724_playback_indep_open()
1428 static int snd_vt1724_playback_indep_close(struct snd_pcm_substream *substream) snd_vt1724_playback_indep_close() argument
1430 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_vt1724_playback_indep_close()
1434 ice->playback_con_substream_ds[substream->number] = NULL; snd_vt1724_playback_indep_close()
1435 ice->pcm_reserved[substream->number] = NULL; snd_vt1724_playback_indep_close()
1003 set_rate_constraints(struct snd_ice1712 *ice, struct snd_pcm_substream *substream) set_rate_constraints() argument
H A Dice1712.c372 static void open_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream) open_cs8427() argument
377 static void close_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream) close_cs8427() argument
468 struct snd_pcm_substream *substream; snd_ice1712_interrupt() local
474 substream = ice->playback_con_substream_ds[idx]; snd_ice1712_interrupt()
475 if (substream != NULL) snd_ice1712_interrupt()
476 snd_pcm_period_elapsed(substream); snd_ice1712_interrupt()
500 static int snd_ice1712_hw_params(struct snd_pcm_substream *substream, snd_ice1712_hw_params() argument
503 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ice1712_hw_params()
506 static int snd_ice1712_hw_free(struct snd_pcm_substream *substream) snd_ice1712_hw_free() argument
508 return snd_pcm_lib_free_pages(substream); snd_ice1712_hw_free()
515 static int snd_ice1712_playback_trigger(struct snd_pcm_substream *substream, snd_ice1712_playback_trigger() argument
518 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_trigger()
540 static int snd_ice1712_playback_ds_trigger(struct snd_pcm_substream *substream, snd_ice1712_playback_ds_trigger() argument
543 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_ds_trigger()
548 tmp = snd_ice1712_ds_read(ice, substream->number * 2, ICE1712_DSC_CONTROL); snd_ice1712_playback_ds_trigger()
560 snd_ice1712_ds_write(ice, substream->number * 2, ICE1712_DSC_CONTROL, tmp); snd_ice1712_playback_ds_trigger()
565 static int snd_ice1712_capture_trigger(struct snd_pcm_substream *substream, snd_ice1712_capture_trigger() argument
568 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_trigger()
586 static int snd_ice1712_playback_prepare(struct snd_pcm_substream *substream) snd_ice1712_playback_prepare() argument
588 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_prepare()
589 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_prepare()
592 period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; snd_ice1712_playback_prepare()
593 buf_size = snd_pcm_lib_buffer_bytes(substream) - 1; snd_ice1712_playback_prepare()
619 static int snd_ice1712_playback_ds_prepare(struct snd_pcm_substream *substream) snd_ice1712_playback_ds_prepare() argument
621 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_ds_prepare()
622 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_ds_prepare()
625 period_size = snd_pcm_lib_period_bytes(substream) - 1; snd_ice1712_playback_ds_prepare()
634 ice->playback_con_active_buf[substream->number] = 0; snd_ice1712_playback_ds_prepare()
635 ice->playback_con_virt_addr[substream->number] = runtime->dma_addr; snd_ice1712_playback_ds_prepare()
636 chn = substream->number * 2; snd_ice1712_playback_ds_prepare()
653 static int snd_ice1712_capture_prepare(struct snd_pcm_substream *substream) snd_ice1712_capture_prepare() argument
655 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_prepare()
656 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_prepare()
660 period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; snd_ice1712_capture_prepare()
661 buf_size = snd_pcm_lib_buffer_bytes(substream) - 1; snd_ice1712_capture_prepare()
678 static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream *substream) snd_ice1712_playback_pointer() argument
680 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pointer()
681 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_pointer()
687 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_pointer()
693 static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream) snd_ice1712_playback_ds_pointer() argument
695 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_ds_pointer()
699 if (!(snd_ice1712_ds_read(ice, substream->number * 2, ICE1712_DSC_CONTROL) & 1)) snd_ice1712_playback_ds_pointer()
701 if (ice->playback_con_active_buf[substream->number]) snd_ice1712_playback_ds_pointer()
705 ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) - snd_ice1712_playback_ds_pointer()
706 ice->playback_con_virt_addr[substream->number]; snd_ice1712_playback_ds_pointer()
707 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_ds_pointer()
708 if (ptr == substream->runtime->buffer_size) snd_ice1712_playback_ds_pointer()
713 static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream) snd_ice1712_capture_pointer() argument
715 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pointer()
721 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_capture_pointer()
722 if (ptr == substream->runtime->buffer_size) snd_ice1712_capture_pointer()
783 static int snd_ice1712_playback_open(struct snd_pcm_substream *substream) snd_ice1712_playback_open() argument
785 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_open()
786 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_open()
788 ice->playback_con_substream = substream; snd_ice1712_playback_open()
793 static int snd_ice1712_playback_ds_open(struct snd_pcm_substream *substream) snd_ice1712_playback_ds_open() argument
795 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_ds_open()
796 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_ds_open()
799 ice->playback_con_substream_ds[substream->number] = substream; snd_ice1712_playback_ds_open()
802 tmp = inw(ICEDS(ice, INTMASK)) & ~(1 << (substream->number * 2)); snd_ice1712_playback_ds_open()
808 static int snd_ice1712_capture_open(struct snd_pcm_substream *substream) snd_ice1712_capture_open() argument
810 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_open()
811 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_open()
813 ice->capture_con_substream = substream; snd_ice1712_capture_open()
821 static int snd_ice1712_playback_close(struct snd_pcm_substream *substream) snd_ice1712_playback_close() argument
823 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_close()
829 static int snd_ice1712_playback_ds_close(struct snd_pcm_substream *substream) snd_ice1712_playback_ds_close() argument
831 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_ds_close()
835 tmp = inw(ICEDS(ice, INTMASK)) | (3 << (substream->number * 2)); snd_ice1712_playback_ds_close()
838 ice->playback_con_substream_ds[substream->number] = NULL; snd_ice1712_playback_ds_close()
842 static int snd_ice1712_capture_close(struct snd_pcm_substream *substream) snd_ice1712_capture_close() argument
844 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_close()
944 static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream, snd_ice1712_pro_trigger() argument
947 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_pro_trigger()
954 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) snd_ice1712_pro_trigger()
957 snd_pcm_trigger_done(substream, substream); snd_ice1712_pro_trigger()
975 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
978 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
981 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1058 static int snd_ice1712_playback_pro_prepare(struct snd_pcm_substream *substream) snd_ice1712_playback_pro_prepare() argument
1060 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pro_prepare()
1062 ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream); snd_ice1712_playback_pro_prepare()
1064 outl(substream->runtime->dma_addr, ICEMT(ice, PLAYBACK_ADDR)); snd_ice1712_playback_pro_prepare()
1066 outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT(ice, PLAYBACK_COUNT)); snd_ice1712_playback_pro_prepare()
1072 static int snd_ice1712_playback_pro_hw_params(struct snd_pcm_substream *substream, snd_ice1712_playback_pro_hw_params() argument
1075 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pro_hw_params()
1078 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ice1712_playback_pro_hw_params()
1081 static int snd_ice1712_capture_pro_prepare(struct snd_pcm_substream *substream) snd_ice1712_capture_pro_prepare() argument
1083 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pro_prepare()
1085 ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream); snd_ice1712_capture_pro_prepare()
1087 outl(substream->runtime->dma_addr, ICEMT(ice, CAPTURE_ADDR)); snd_ice1712_capture_pro_prepare()
1089 outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT(ice, CAPTURE_COUNT)); snd_ice1712_capture_pro_prepare()
1094 static int snd_ice1712_capture_pro_hw_params(struct snd_pcm_substream *substream, snd_ice1712_capture_pro_hw_params() argument
1097 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pro_hw_params()
1100 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ice1712_capture_pro_hw_params()
1103 static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substream *substream) snd_ice1712_playback_pro_pointer() argument
1105 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pro_pointer()
1111 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_playback_pro_pointer()
1112 if (ptr == substream->runtime->buffer_size) snd_ice1712_playback_pro_pointer()
1117 static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream) snd_ice1712_capture_pro_pointer() argument
1119 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pro_pointer()
1125 ptr = bytes_to_frames(substream->runtime, ptr); snd_ice1712_capture_pro_pointer()
1126 if (ptr == substream->runtime->buffer_size) snd_ice1712_capture_pro_pointer()
1169 static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream) snd_ice1712_playback_pro_open() argument
1171 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_playback_pro_open()
1172 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pro_open()
1174 ice->playback_pro_substream = substream; snd_ice1712_playback_pro_open()
1176 snd_pcm_set_sync(substream); snd_ice1712_playback_pro_open()
1185 ice->spdif.ops.open(ice, substream); snd_ice1712_playback_pro_open()
1190 static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream) snd_ice1712_capture_pro_open() argument
1192 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pro_open()
1193 struct snd_pcm_runtime *runtime = substream->runtime; snd_ice1712_capture_pro_open()
1195 ice->capture_pro_substream = substream; snd_ice1712_capture_pro_open()
1197 snd_pcm_set_sync(substream); snd_ice1712_capture_pro_open()
1208 static int snd_ice1712_playback_pro_close(struct snd_pcm_substream *substream) snd_ice1712_playback_pro_close() argument
1210 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_playback_pro_close()
1216 ice->spdif.ops.close(ice, substream); snd_ice1712_playback_pro_close()
1221 static int snd_ice1712_capture_pro_close(struct snd_pcm_substream *substream) snd_ice1712_capture_pro_close() argument
1223 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); snd_ice1712_capture_pro_close()
1277 pcm->streams[0].substream, snd_ice1712_pcm_profi()
1278 pcm->streams[1].substream); snd_ice1712_pcm_profi()
/linux-4.1.27/sound/atmel/
H A Dabdac.c97 struct snd_pcm_substream *substream; member in struct:atmel_abdac
114 snd_pcm_period_elapsed(dac->substream); atmel_abdac_dma_period_done()
118 struct snd_pcm_substream *substream, atmel_abdac_prepare_dma()
123 struct snd_pcm_runtime *runtime = substream->runtime; atmel_abdac_prepare_dma()
175 static int atmel_abdac_open(struct snd_pcm_substream *substream) atmel_abdac_open() argument
177 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_open()
179 dac->substream = substream; atmel_abdac_open()
182 substream->runtime->hw = atmel_abdac_hw; atmel_abdac_open()
184 return snd_pcm_hw_constraint_list(substream->runtime, 0, atmel_abdac_open()
188 static int atmel_abdac_close(struct snd_pcm_substream *substream) atmel_abdac_close() argument
190 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_close()
191 dac->substream = NULL; atmel_abdac_close()
195 static int atmel_abdac_hw_params(struct snd_pcm_substream *substream, atmel_abdac_hw_params() argument
198 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_hw_params()
201 retval = snd_pcm_lib_malloc_pages(substream, atmel_abdac_hw_params()
213 static int atmel_abdac_hw_free(struct snd_pcm_substream *substream) atmel_abdac_hw_free() argument
215 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_hw_free()
218 return snd_pcm_lib_free_pages(substream); atmel_abdac_hw_free()
221 static int atmel_abdac_prepare(struct snd_pcm_substream *substream) atmel_abdac_prepare() argument
223 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_prepare()
226 retval = clk_set_rate(dac->sample_clk, 256 * substream->runtime->rate); atmel_abdac_prepare()
231 retval = atmel_abdac_prepare_dma(dac, substream, DMA_TO_DEVICE); atmel_abdac_prepare()
236 static int atmel_abdac_trigger(struct snd_pcm_substream *substream, int cmd) atmel_abdac_trigger() argument
238 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_trigger()
268 atmel_abdac_pointer(struct snd_pcm_substream *substream) atmel_abdac_pointer() argument
270 struct atmel_abdac *dac = snd_pcm_substream_chip(substream); atmel_abdac_pointer()
271 struct snd_pcm_runtime *runtime = substream->runtime; atmel_abdac_pointer()
117 atmel_abdac_prepare_dma(struct atmel_abdac *dac, struct snd_pcm_substream *substream, enum dma_data_direction direction) atmel_abdac_prepare_dma() argument
H A Dac97c.c108 struct snd_pcm_substream *substream, atmel_ac97c_prepare_dma()
113 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_prepare_dma()
175 static int atmel_ac97c_playback_open(struct snd_pcm_substream *substream) atmel_ac97c_playback_open() argument
177 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_open()
178 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_open()
190 chip->playback_substream = substream; atmel_ac97c_playback_open()
194 static int atmel_ac97c_capture_open(struct snd_pcm_substream *substream) atmel_ac97c_capture_open() argument
196 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_open()
197 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_open()
209 chip->capture_substream = substream; atmel_ac97c_capture_open()
213 static int atmel_ac97c_playback_close(struct snd_pcm_substream *substream) atmel_ac97c_playback_close() argument
215 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_close()
230 static int atmel_ac97c_capture_close(struct snd_pcm_substream *substream) atmel_ac97c_capture_close() argument
232 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_close()
247 static int atmel_ac97c_playback_hw_params(struct snd_pcm_substream *substream, atmel_ac97c_playback_hw_params() argument
250 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_hw_params()
253 retval = snd_pcm_lib_malloc_pages(substream, atmel_ac97c_playback_hw_params()
273 static int atmel_ac97c_capture_hw_params(struct snd_pcm_substream *substream, atmel_ac97c_capture_hw_params() argument
276 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_hw_params()
279 retval = snd_pcm_lib_malloc_pages(substream, atmel_ac97c_capture_hw_params()
297 static int atmel_ac97c_playback_hw_free(struct snd_pcm_substream *substream) atmel_ac97c_playback_hw_free() argument
299 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_hw_free()
304 return snd_pcm_lib_free_pages(substream); atmel_ac97c_playback_hw_free()
307 static int atmel_ac97c_capture_hw_free(struct snd_pcm_substream *substream) atmel_ac97c_capture_hw_free() argument
309 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_hw_free()
314 return snd_pcm_lib_free_pages(substream); atmel_ac97c_capture_hw_free()
317 static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream) atmel_ac97c_playback_prepare() argument
319 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_prepare()
320 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_prepare()
394 retval = atmel_ac97c_prepare_dma(chip, substream, atmel_ac97c_playback_prepare()
408 static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream) atmel_ac97c_capture_prepare() argument
410 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_prepare()
411 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_prepare()
485 retval = atmel_ac97c_prepare_dma(chip, substream, atmel_ac97c_capture_prepare()
500 atmel_ac97c_playback_trigger(struct snd_pcm_substream *substream, int cmd) atmel_ac97c_playback_trigger() argument
502 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_trigger()
544 atmel_ac97c_capture_trigger(struct snd_pcm_substream *substream, int cmd) atmel_ac97c_capture_trigger() argument
546 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_trigger()
589 atmel_ac97c_playback_pointer(struct snd_pcm_substream *substream) atmel_ac97c_playback_pointer() argument
591 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_playback_pointer()
592 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_playback_pointer()
609 atmel_ac97c_capture_pointer(struct snd_pcm_substream *substream) atmel_ac97c_capture_pointer() argument
611 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); atmel_ac97c_capture_pointer()
612 struct snd_pcm_runtime *runtime = substream->runtime; atmel_ac97c_capture_pointer()
107 atmel_ac97c_prepare_dma(struct atmel_ac97c *chip, struct snd_pcm_substream *substream, enum dma_transfer_direction direction) atmel_ac97c_prepare_dma() argument
/linux-4.1.27/sound/core/seq/
H A Dseq_virmidi.c93 snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); snd_virmidi_dev_receive_event()
97 snd_rawmidi_receive(vmidi->substream, msg, len); snd_virmidi_dev_receive_event()
139 static void snd_virmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_virmidi_input_trigger() argument
141 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_input_trigger()
153 static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_virmidi_output_trigger() argument
155 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_output_trigger()
164 while (snd_rawmidi_transmit(substream, buf, snd_virmidi_output_trigger()
175 spin_lock_irqsave(&substream->runtime->lock, flags); snd_virmidi_output_trigger()
177 count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf)); snd_virmidi_output_trigger()
187 __snd_rawmidi_transmit_ack(substream, res); snd_virmidi_output_trigger()
198 spin_unlock_irqrestore(&substream->runtime->lock, flags); snd_virmidi_output_trigger()
207 static int snd_virmidi_input_open(struct snd_rawmidi_substream *substream) snd_virmidi_input_open() argument
209 struct snd_virmidi_dev *rdev = substream->rmidi->private_data; snd_virmidi_input_open()
210 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_virmidi_input_open()
217 vmidi->substream = substream; snd_virmidi_input_open()
236 static int snd_virmidi_output_open(struct snd_rawmidi_substream *substream) snd_virmidi_output_open() argument
238 struct snd_virmidi_dev *rdev = substream->rmidi->private_data; snd_virmidi_output_open()
239 struct snd_rawmidi_runtime *runtime = substream->runtime; snd_virmidi_output_open()
245 vmidi->substream = substream; snd_virmidi_output_open()
262 static int snd_virmidi_input_close(struct snd_rawmidi_substream *substream) snd_virmidi_input_close() argument
264 struct snd_virmidi_dev *rdev = substream->rmidi->private_data; snd_virmidi_input_close()
265 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_input_close()
271 substream->runtime->private_data = NULL; snd_virmidi_input_close()
279 static int snd_virmidi_output_close(struct snd_rawmidi_substream *substream) snd_virmidi_output_close() argument
281 struct snd_virmidi *vmidi = substream->runtime->private_data; snd_virmidi_output_close()
283 substream->runtime->private_data = NULL; snd_virmidi_output_close()
H A Dseq_midi.c75 static void snd_midi_input_event(struct snd_rawmidi_substream *substream) snd_midi_input_event() argument
83 if (substream == NULL) snd_midi_input_event()
85 runtime = substream->runtime; snd_midi_input_event()
91 res = snd_rawmidi_kernel_read(substream, buf, sizeof(buf)); snd_midi_input_event()
114 static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count) dump_midi() argument
119 if (snd_BUG_ON(!substream || !buf)) dump_midi()
121 runtime = substream->runtime; dump_midi()
127 if (snd_rawmidi_kernel_write(substream, buf, count) < count) dump_midi()
137 struct snd_rawmidi_substream *substream; event_process_midi() local
142 substream = msynth->output_rfile.output; event_process_midi()
143 if (substream == NULL) event_process_midi()
151 snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream); event_process_midi()
159 if (dump_midi(substream, msg, len) < 0) event_process_midi()
/linux-4.1.27/sound/ppc/
H A Dsnd_ps3.c352 snd_pcm_period_elapsed(card->substream); snd_ps3_interrupt()
450 * set sampling rate according to the substream
452 static int snd_ps3_set_avsetting(struct snd_pcm_substream *substream) snd_ps3_set_avsetting() argument
454 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); snd_ps3_set_avsetting()
461 substream->runtime->rate, snd_ps3_set_avsetting()
462 snd_pcm_format_width(substream->runtime->format)); snd_ps3_set_avsetting()
468 switch (substream->runtime->rate) { snd_ps3_set_avsetting()
483 substream->runtime->rate); snd_ps3_set_avsetting()
488 switch (snd_pcm_format_width(substream->runtime->format)) { snd_ps3_set_avsetting()
497 snd_pcm_format_width(substream->runtime->format)); snd_ps3_set_avsetting()
525 static int snd_ps3_pcm_open(struct snd_pcm_substream *substream) snd_ps3_pcm_open() argument
527 struct snd_pcm_runtime *runtime = substream->runtime; snd_ps3_pcm_open()
528 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); snd_ps3_pcm_open()
531 pcm_index = substream->pcm->device; snd_ps3_pcm_open()
532 /* to retrieve substream/runtime in interrupt handler */ snd_ps3_pcm_open()
533 card->substream = substream; snd_ps3_pcm_open()
547 static int snd_ps3_pcm_close(struct snd_pcm_substream *substream) snd_ps3_pcm_close() argument
554 static int snd_ps3_pcm_hw_params(struct snd_pcm_substream *substream, snd_ps3_pcm_hw_params() argument
561 snd_pcm_lib_malloc_pages(substream, size); snd_ps3_pcm_hw_params()
565 static int snd_ps3_pcm_hw_free(struct snd_pcm_substream *substream) snd_ps3_pcm_hw_free() argument
568 ret = snd_pcm_lib_free_pages(substream); snd_ps3_pcm_hw_free()
572 static int snd_ps3_delay_to_bytes(struct snd_pcm_substream *substream, snd_ps3_delay_to_bytes() argument
578 rate = substream->runtime->rate; snd_ps3_delay_to_bytes()
579 ret = snd_pcm_format_size(substream->runtime->format, snd_ps3_delay_to_bytes()
581 * substream->runtime->channels; snd_ps3_delay_to_bytes()
587 snd_pcm_format_size(substream->runtime->format, rate), snd_ps3_delay_to_bytes()
594 static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream) snd_ps3_pcm_prepare() argument
596 struct snd_pcm_runtime *runtime = substream->runtime; snd_ps3_pcm_prepare()
597 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); snd_ps3_pcm_prepare()
600 if (!snd_ps3_set_avsetting(substream)) { snd_ps3_pcm_prepare()
609 card->silent = snd_ps3_delay_to_bytes(substream, snd_ps3_pcm_prepare()
645 static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream, snd_ps3_pcm_trigger() argument
648 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); snd_ps3_pcm_trigger()
693 struct snd_pcm_substream *substream) snd_ps3_pcm_pointer()
695 struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); snd_ps3_pcm_pointer()
706 ret = bytes_to_frames(substream->runtime, bytes * 2); snd_ps3_pcm_pointer()
1005 /* NOTE:this driver works assuming pcm:substream = 1:1 */ snd_ps3_driver_probe()
1009 1, /* output substream */ snd_ps3_driver_probe()
1010 0, /* input substream */ snd_ps3_driver_probe()
692 snd_ps3_pcm_pointer( struct snd_pcm_substream *substream) snd_ps3_pcm_pointer() argument
/linux-4.1.27/sound/pci/ca0106/
H A Dca_midi.c123 static int ca_midi_input_open(struct snd_rawmidi_substream *substream) ca_midi_input_open() argument
125 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_input_open()
132 midi->substream_input = substream; ca_midi_input_open()
143 static int ca_midi_output_open(struct snd_rawmidi_substream *substream) ca_midi_output_open() argument
145 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_output_open()
152 midi->substream_output = substream; ca_midi_output_open()
163 static int ca_midi_input_close(struct snd_rawmidi_substream *substream) ca_midi_input_close() argument
165 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_input_close()
183 static int ca_midi_output_close(struct snd_rawmidi_substream *substream) ca_midi_output_close() argument
185 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_output_close()
206 static void ca_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) ca_midi_input_trigger() argument
208 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_input_trigger()
220 static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) ca_midi_output_trigger() argument
222 struct snd_ca_midi *midi = substream->rmidi->private_data; ca_midi_output_trigger()
238 snd_rawmidi_transmit(substream, &byte, 1) != 1) { ca_midi_output_trigger()
H A Dca0106_main.c560 static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substream, snd_ca0106_pcm_open_playback_channel() argument
563 struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); snd_ca0106_pcm_open_playback_channel()
566 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_open_playback_channel()
574 epcm->substream = substream; snd_ca0106_pcm_open_playback_channel()
596 snd_pcm_set_sync(substream); snd_ca0106_pcm_open_playback_channel()
611 static int snd_ca0106_pcm_close_playback(struct snd_pcm_substream *substream) snd_ca0106_pcm_close_playback() argument
613 struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); snd_ca0106_pcm_close_playback()
614 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_close_playback()
632 static int snd_ca0106_pcm_open_playback_front(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_playback_front() argument
634 return snd_ca0106_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); snd_ca0106_pcm_open_playback_front()
637 static int snd_ca0106_pcm_open_playback_center_lfe(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_playback_center_lfe() argument
639 return snd_ca0106_pcm_open_playback_channel(substream, PCM_CENTER_LFE_CHANNEL); snd_ca0106_pcm_open_playback_center_lfe()
642 static int snd_ca0106_pcm_open_playback_unknown(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_playback_unknown() argument
644 return snd_ca0106_pcm_open_playback_channel(substream, PCM_UNKNOWN_CHANNEL); snd_ca0106_pcm_open_playback_unknown()
647 static int snd_ca0106_pcm_open_playback_rear(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_playback_rear() argument
649 return snd_ca0106_pcm_open_playback_channel(substream, PCM_REAR_CHANNEL); snd_ca0106_pcm_open_playback_rear()
653 static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substream, snd_ca0106_pcm_open_capture_channel() argument
656 struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); snd_ca0106_pcm_open_capture_channel()
659 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_open_capture_channel()
669 epcm->substream = substream; snd_ca0106_pcm_open_capture_channel()
696 static int snd_ca0106_pcm_close_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_close_capture() argument
698 struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); snd_ca0106_pcm_close_capture()
699 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_close_capture()
706 static int snd_ca0106_pcm_open_0_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_0_capture() argument
708 return snd_ca0106_pcm_open_capture_channel(substream, 0); snd_ca0106_pcm_open_0_capture()
711 static int snd_ca0106_pcm_open_1_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_1_capture() argument
713 return snd_ca0106_pcm_open_capture_channel(substream, 1); snd_ca0106_pcm_open_1_capture()
716 static int snd_ca0106_pcm_open_2_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_2_capture() argument
718 return snd_ca0106_pcm_open_capture_channel(substream, 2); snd_ca0106_pcm_open_2_capture()
721 static int snd_ca0106_pcm_open_3_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_open_3_capture() argument
723 return snd_ca0106_pcm_open_capture_channel(substream, 3); snd_ca0106_pcm_open_3_capture()
727 static int snd_ca0106_pcm_hw_params_playback(struct snd_pcm_substream *substream, snd_ca0106_pcm_hw_params_playback() argument
730 return snd_pcm_lib_malloc_pages(substream, snd_ca0106_pcm_hw_params_playback()
735 static int snd_ca0106_pcm_hw_free_playback(struct snd_pcm_substream *substream) snd_ca0106_pcm_hw_free_playback() argument
737 return snd_pcm_lib_free_pages(substream); snd_ca0106_pcm_hw_free_playback()
741 static int snd_ca0106_pcm_hw_params_capture(struct snd_pcm_substream *substream, snd_ca0106_pcm_hw_params_capture() argument
744 return snd_pcm_lib_malloc_pages(substream, snd_ca0106_pcm_hw_params_capture()
749 static int snd_ca0106_pcm_hw_free_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_hw_free_capture() argument
751 return snd_pcm_lib_free_pages(substream); snd_ca0106_pcm_hw_free_capture()
755 static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream) snd_ca0106_pcm_prepare_playback() argument
757 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_prepare_playback()
758 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_prepare_playback()
868 static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_prepare_capture() argument
870 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_prepare_capture()
871 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_prepare_capture()
959 static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, snd_ca0106_pcm_trigger_playback() argument
962 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_trigger_playback()
984 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
995 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1026 static int snd_ca0106_pcm_trigger_capture(struct snd_pcm_substream *substream, snd_ca0106_pcm_trigger_capture() argument
1029 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_trigger_capture()
1030 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_trigger_capture()
1055 snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream) snd_ca0106_pcm_pointer_playback() argument
1057 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_pointer_playback()
1058 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_pointer_playback()
1085 snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream) snd_ca0106_pcm_pointer_capture() argument
1087 struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); snd_ca0106_pcm_pointer_capture()
1088 struct snd_pcm_runtime *runtime = substream->runtime; snd_ca0106_pcm_pointer_capture()
1302 /* FIXME: Select the correct substream for period elapsed */ snd_ca0106_interrupt()
1304 snd_pcm_period_elapsed(pchannel->epcm->substream); snd_ca0106_interrupt()
1318 /* FIXME: Select the correct substream for period elapsed */ snd_ca0106_interrupt()
1320 snd_pcm_period_elapsed(pchannel->epcm->substream); snd_ca0106_interrupt()
1368 struct snd_pcm_substream *substream; snd_ca0106_pcm() local
1404 for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; snd_ca0106_pcm()
1405 substream; snd_ca0106_pcm()
1406 substream = substream->next) { snd_ca0106_pcm()
1407 if ((err = snd_pcm_lib_preallocate_pages(substream, snd_ca0106_pcm()
1414 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; snd_ca0106_pcm()
1415 substream; snd_ca0106_pcm()
1416 substream = substream->next) { snd_ca0106_pcm()
1417 if ((err = snd_pcm_lib_preallocate_pages(substream, snd_ca0106_pcm()
/linux-4.1.27/sound/pci/
H A Dals300.c369 static int snd_als300_playback_open(struct snd_pcm_substream *substream) snd_als300_playback_open() argument
371 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_playback_open()
372 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_playback_open()
378 chip->playback_substream = substream; snd_als300_playback_open()
386 static int snd_als300_playback_close(struct snd_pcm_substream *substream) snd_als300_playback_close() argument
388 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_playback_close()
391 data = substream->runtime->private_data; snd_als300_playback_close()
394 snd_pcm_lib_free_pages(substream); snd_als300_playback_close()
398 static int snd_als300_capture_open(struct snd_pcm_substream *substream) snd_als300_capture_open() argument
400 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_capture_open()
401 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_capture_open()
407 chip->capture_substream = substream; snd_als300_capture_open()
415 static int snd_als300_capture_close(struct snd_pcm_substream *substream) snd_als300_capture_close() argument
417 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_capture_close()
420 data = substream->runtime->private_data; snd_als300_capture_close()
423 snd_pcm_lib_free_pages(substream); snd_als300_capture_close()
427 static int snd_als300_pcm_hw_params(struct snd_pcm_substream *substream, snd_als300_pcm_hw_params() argument
430 return snd_pcm_lib_malloc_pages(substream, snd_als300_pcm_hw_params()
434 static int snd_als300_pcm_hw_free(struct snd_pcm_substream *substream) snd_als300_pcm_hw_free() argument
436 return snd_pcm_lib_free_pages(substream); snd_als300_pcm_hw_free()
439 static int snd_als300_playback_prepare(struct snd_pcm_substream *substream) snd_als300_playback_prepare() argument
442 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_playback_prepare()
443 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_playback_prepare()
444 unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); snd_als300_playback_prepare()
445 unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); snd_als300_playback_prepare()
468 static int snd_als300_capture_prepare(struct snd_pcm_substream *substream) snd_als300_capture_prepare() argument
471 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_capture_prepare()
472 struct snd_pcm_runtime *runtime = substream->runtime; snd_als300_capture_prepare()
473 unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); snd_als300_capture_prepare()
474 unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); snd_als300_capture_prepare()
497 static int snd_als300_trigger(struct snd_pcm_substream *substream, int cmd) snd_als300_trigger() argument
499 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_trigger()
505 data = substream->runtime->private_data; snd_als300_trigger()
541 static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream) snd_als300_pointer() argument
544 struct snd_als300 *chip = snd_pcm_substream_chip(substream); snd_als300_pointer()
548 data = substream->runtime->private_data; snd_als300_pointer()
549 period_bytes = snd_pcm_lib_period_bytes(substream); snd_als300_pointer()
563 return bytes_to_frames(substream->runtime, current_ptr); snd_als300_pointer()
H A Drme32.c240 static int snd_rme32_playback_prepare(struct snd_pcm_substream *substream);
242 static int snd_rme32_capture_prepare(struct snd_pcm_substream *substream);
244 static int snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
257 static int snd_rme32_playback_silence(struct snd_pcm_substream *substream, int channel, /* not used (interleaved data) */ snd_rme32_playback_silence() argument
261 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_silence()
269 static int snd_rme32_playback_copy(struct snd_pcm_substream *substream, int channel, /* not used (interleaved data) */ snd_rme32_playback_copy() argument
273 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_copy()
283 static int snd_rme32_capture_copy(struct snd_pcm_substream *substream, int channel, /* not used (interleaved data) */ snd_rme32_capture_copy() argument
287 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_copy()
651 snd_rme32_playback_hw_params(struct snd_pcm_substream *substream, snd_rme32_playback_hw_params() argument
655 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_hw_params()
656 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_hw_params()
659 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); snd_rme32_playback_hw_params()
706 snd_rme32_capture_hw_params(struct snd_pcm_substream *substream, snd_rme32_capture_hw_params() argument
710 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_hw_params()
711 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_hw_params()
714 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); snd_rme32_capture_hw_params()
767 static int snd_rme32_pcm_hw_free(struct snd_pcm_substream *substream) snd_rme32_pcm_hw_free() argument
769 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_pcm_hw_free()
772 return snd_pcm_lib_free_pages(substream); snd_rme32_pcm_hw_free()
843 static int snd_rme32_playback_spdif_open(struct snd_pcm_substream *substream) snd_rme32_playback_spdif_open() argument
846 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_spdif_open()
847 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_spdif_open()
849 snd_pcm_set_sync(substream); snd_rme32_playback_spdif_open()
858 rme32->playback_substream = substream; snd_rme32_playback_spdif_open()
886 static int snd_rme32_capture_spdif_open(struct snd_pcm_substream *substream) snd_rme32_capture_spdif_open() argument
889 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_spdif_open()
890 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_spdif_open()
892 snd_pcm_set_sync(substream); snd_rme32_capture_spdif_open()
899 rme32->capture_substream = substream; snd_rme32_capture_spdif_open()
925 snd_rme32_playback_adat_open(struct snd_pcm_substream *substream) snd_rme32_playback_adat_open() argument
928 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_adat_open()
929 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_playback_adat_open()
931 snd_pcm_set_sync(substream); snd_rme32_playback_adat_open()
940 rme32->playback_substream = substream; snd_rme32_playback_adat_open()
960 snd_rme32_capture_adat_open(struct snd_pcm_substream *substream) snd_rme32_capture_adat_open() argument
963 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_adat_open()
964 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme32_capture_adat_open()
979 snd_pcm_set_sync(substream); snd_rme32_capture_adat_open()
986 rme32->capture_substream = substream; snd_rme32_capture_adat_open()
993 static int snd_rme32_playback_close(struct snd_pcm_substream *substream) snd_rme32_playback_close() argument
995 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_close()
1012 static int snd_rme32_capture_close(struct snd_pcm_substream *substream) snd_rme32_capture_close() argument
1014 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_close()
1023 static int snd_rme32_playback_prepare(struct snd_pcm_substream *substream) snd_rme32_playback_prepare() argument
1025 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_prepare()
1031 rme32->playback_pcm.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_rme32_playback_prepare()
1042 static int snd_rme32_capture_prepare(struct snd_pcm_substream *substream) snd_rme32_capture_prepare() argument
1044 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_prepare()
1051 rme32->capture_pcm.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_rme32_capture_prepare()
1060 snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_rme32_pcm_trigger() argument
1062 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_pcm_trigger()
1066 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1088 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1093 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1125 snd_rme32_playback_pointer(struct snd_pcm_substream *substream) snd_rme32_playback_pointer() argument
1127 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_pointer()
1132 snd_rme32_capture_pointer(struct snd_pcm_substream *substream) snd_rme32_capture_pointer() argument
1134 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_pointer()
1140 static void snd_rme32_pb_trans_copy(struct snd_pcm_substream *substream, snd_rme32_pb_trans_copy() argument
1143 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_pb_trans_copy()
1145 substream->runtime->dma_area + rec->sw_data, bytes); snd_rme32_pb_trans_copy()
1148 static int snd_rme32_playback_fd_ack(struct snd_pcm_substream *substream) snd_rme32_playback_fd_ack() argument
1150 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_fd_ack()
1160 snd_pcm_indirect_playback_transfer(substream, rec, snd_rme32_playback_fd_ack()
1165 static void snd_rme32_cp_trans_copy(struct snd_pcm_substream *substream, snd_rme32_cp_trans_copy() argument
1168 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_cp_trans_copy()
1169 memcpy_fromio(substream->runtime->dma_area + rec->sw_data, snd_rme32_cp_trans_copy()
1174 static int snd_rme32_capture_fd_ack(struct snd_pcm_substream *substream) snd_rme32_capture_fd_ack() argument
1176 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_fd_ack()
1177 snd_pcm_indirect_capture_transfer(substream, &rme32->capture_pcm, snd_rme32_capture_fd_ack()
1183 snd_rme32_playback_fd_pointer(struct snd_pcm_substream *substream) snd_rme32_playback_fd_pointer() argument
1185 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_playback_fd_pointer()
1186 return snd_pcm_indirect_playback_pointer(substream, &rme32->playback_pcm, snd_rme32_playback_fd_pointer()
1191 snd_rme32_capture_fd_pointer(struct snd_pcm_substream *substream) snd_rme32_capture_fd_pointer() argument
1193 struct rme32 *rme32 = snd_pcm_substream_chip(substream); snd_rme32_capture_fd_pointer()
1194 return snd_pcm_indirect_capture_pointer(substream, &rme32->capture_pcm, snd_rme32_capture_fd_pointer()
H A Datiixp.c247 struct snd_pcm_substream *substream; /* assigned PCM substream */ member in struct:atiixp_dma
357 struct snd_pcm_substream *substream, atiixp_build_dma_packets()
388 addr = (u32)substream->runtime->dma_addr; atiixp_build_dma_packets()
417 struct snd_pcm_substream *substream) atiixp_clear_dma_packets()
661 static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substream) snd_atiixp_pcm_pointer() argument
663 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_pointer()
664 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_pointer()
684 * XRUN detected, and stop the PCM substream
688 if (! dma->substream || ! dma->running) snd_atiixp_xrun_dma()
691 snd_pcm_stop_xrun(dma->substream); snd_atiixp_xrun_dma()
695 * the period ack. update the substream.
699 if (! dma->substream || ! dma->running) snd_atiixp_update_dma()
701 snd_pcm_period_elapsed(dma->substream); snd_atiixp_update_dma()
721 static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_atiixp_pcm_trigger() argument
723 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_trigger()
724 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_trigger()
868 static int snd_atiixp_spdif_prepare(struct snd_pcm_substream *substream) snd_atiixp_spdif_prepare() argument
870 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_spdif_prepare()
884 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_spdif_prepare()
895 static int snd_atiixp_playback_prepare(struct snd_pcm_substream *substream) snd_atiixp_playback_prepare() argument
897 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_prepare()
902 switch (substream->runtime->channels) { snd_atiixp_playback_prepare()
926 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_playback_prepare()
933 substream->runtime->channels >= 6 ? ATI_REG_6CH_REORDER_EN: 0); snd_atiixp_playback_prepare()
940 static int snd_atiixp_capture_prepare(struct snd_pcm_substream *substream) snd_atiixp_capture_prepare() argument
942 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_capture_prepare()
946 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ? snd_atiixp_capture_prepare()
955 static int snd_atiixp_pcm_hw_params(struct snd_pcm_substream *substream, snd_atiixp_pcm_hw_params() argument
958 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_hw_params()
959 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_params()
962 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_atiixp_pcm_hw_params()
965 dma->buf_addr = substream->runtime->dma_addr; snd_atiixp_pcm_hw_params()
968 err = atiixp_build_dma_packets(chip, dma, substream, snd_atiixp_pcm_hw_params()
993 static int snd_atiixp_pcm_hw_free(struct snd_pcm_substream *substream) snd_atiixp_pcm_hw_free() argument
995 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_hw_free()
996 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_free()
1003 atiixp_clear_dma_packets(chip, dma, substream); snd_atiixp_pcm_hw_free()
1004 snd_pcm_lib_free_pages(substream); snd_atiixp_pcm_hw_free()
1032 static int snd_atiixp_pcm_open(struct snd_pcm_substream *substream, snd_atiixp_pcm_open() argument
1035 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_open()
1036 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_open()
1044 dma->substream = substream; snd_atiixp_pcm_open()
1067 static int snd_atiixp_pcm_close(struct snd_pcm_substream *substream, snd_atiixp_pcm_close() argument
1070 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_close()
1077 dma->substream = NULL; snd_atiixp_pcm_close()
1084 static int snd_atiixp_playback_open(struct snd_pcm_substream *substream) snd_atiixp_playback_open() argument
1086 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_open()
1090 err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0); snd_atiixp_playback_open()
1094 substream->runtime->hw.channels_max = chip->max_channels; snd_atiixp_playback_open()
1097 snd_pcm_hw_constraint_step(substream->runtime, 0, snd_atiixp_playback_open()
1102 static int snd_atiixp_playback_close(struct snd_pcm_substream *substream) snd_atiixp_playback_close() argument
1104 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_close()
1107 err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]); snd_atiixp_playback_close()
1112 static int snd_atiixp_capture_open(struct snd_pcm_substream *substream) snd_atiixp_capture_open() argument
1114 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_capture_open()
1115 return snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_CAPTURE], 1); snd_atiixp_capture_open()
1118 static int snd_atiixp_capture_close(struct snd_pcm_substream *substream) snd_atiixp_capture_close() argument
1120 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_capture_close()
1121 return snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_CAPTURE]); snd_atiixp_capture_close()
1124 static int snd_atiixp_spdif_open(struct snd_pcm_substream *substream) snd_atiixp_spdif_open() argument
1126 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_spdif_open()
1130 err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 2); snd_atiixp_spdif_open()
1132 err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_SPDIF], -1); snd_atiixp_spdif_open()
1137 static int snd_atiixp_spdif_close(struct snd_pcm_substream *substream) snd_atiixp_spdif_close() argument
1139 struct atiixp *chip = snd_pcm_substream_chip(substream); snd_atiixp_spdif_close()
1143 err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]); snd_atiixp_spdif_close()
1145 err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_SPDIF]); snd_atiixp_spdif_close()
1485 if (dma->substream && dma->running) snd_atiixp_suspend()
1512 if (dma->substream && dma->suspended) { snd_atiixp_resume()
1514 dma->substream->ops->prepare(dma->substream); snd_atiixp_resume()
356 atiixp_build_dma_packets(struct atiixp *chip, struct atiixp_dma *dma, struct snd_pcm_substream *substream, unsigned int periods, unsigned int period_bytes) atiixp_build_dma_packets() argument
416 atiixp_clear_dma_packets(struct atiixp *chip, struct atiixp_dma *dma, struct snd_pcm_substream *substream) atiixp_clear_dma_packets() argument
H A Datiixp_modem.c223 struct snd_pcm_substream *substream; /* assigned PCM substream */ member in struct:atiixp_dma
326 struct snd_pcm_substream *substream, atiixp_build_dma_packets()
355 addr = (u32)substream->runtime->dma_addr; atiixp_build_dma_packets()
385 struct snd_pcm_substream *substream) atiixp_clear_dma_packets()
610 static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substream) snd_atiixp_pcm_pointer() argument
612 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_pointer()
613 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_pointer()
633 * XRUN detected, and stop the PCM substream
638 if (! dma->substream || ! dma->running) snd_atiixp_xrun_dma()
641 snd_pcm_stop_xrun(dma->substream); snd_atiixp_xrun_dma()
645 * the period ack. update the substream.
650 if (! dma->substream || ! dma->running) snd_atiixp_update_dma()
652 snd_pcm_period_elapsed(dma->substream); snd_atiixp_update_dma()
671 static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_atiixp_pcm_trigger() argument
673 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_trigger()
674 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_trigger()
768 static int snd_atiixp_playback_prepare(struct snd_pcm_substream *substream) snd_atiixp_playback_prepare() argument
770 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_prepare()
784 static int snd_atiixp_capture_prepare(struct snd_pcm_substream *substream) snd_atiixp_capture_prepare() argument
792 static int snd_atiixp_pcm_hw_params(struct snd_pcm_substream *substream, snd_atiixp_pcm_hw_params() argument
795 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_hw_params()
796 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_params()
800 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_atiixp_pcm_hw_params()
803 dma->buf_addr = substream->runtime->dma_addr; snd_atiixp_pcm_hw_params()
806 err = atiixp_build_dma_packets(chip, dma, substream, snd_atiixp_pcm_hw_params()
823 static int snd_atiixp_pcm_hw_free(struct snd_pcm_substream *substream) snd_atiixp_pcm_hw_free() argument
825 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_hw_free()
826 struct atiixp_dma *dma = substream->runtime->private_data; snd_atiixp_pcm_hw_free()
828 atiixp_clear_dma_packets(chip, dma, substream); snd_atiixp_pcm_hw_free()
829 snd_pcm_lib_free_pages(substream); snd_atiixp_pcm_hw_free()
857 static int snd_atiixp_pcm_open(struct snd_pcm_substream *substream, snd_atiixp_pcm_open() argument
860 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_open()
861 struct snd_pcm_runtime *runtime = substream->runtime; snd_atiixp_pcm_open()
875 dma->substream = substream; snd_atiixp_pcm_open()
896 static int snd_atiixp_pcm_close(struct snd_pcm_substream *substream, snd_atiixp_pcm_close() argument
899 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_pcm_close()
906 dma->substream = NULL; snd_atiixp_pcm_close()
913 static int snd_atiixp_playback_open(struct snd_pcm_substream *substream) snd_atiixp_playback_open() argument
915 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_open()
919 err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0); snd_atiixp_playback_open()
926 static int snd_atiixp_playback_close(struct snd_pcm_substream *substream) snd_atiixp_playback_close() argument
928 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_playback_close()
931 err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]); snd_atiixp_playback_close()
936 static int snd_atiixp_capture_open(struct snd_pcm_substream *substream) snd_atiixp_capture_open() argument
938 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_capture_open()
939 return snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_CAPTURE], 1); snd_atiixp_capture_open()
942 static int snd_atiixp_capture_close(struct snd_pcm_substream *substream) snd_atiixp_capture_close() argument
944 struct atiixp_modem *chip = snd_pcm_substream_chip(substream); snd_atiixp_capture_close()
945 return snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_CAPTURE]); snd_atiixp_capture_close()
324 atiixp_build_dma_packets(struct atiixp_modem *chip, struct atiixp_dma *dma, struct snd_pcm_substream *substream, unsigned int periods, unsigned int period_bytes) atiixp_build_dma_packets() argument
383 atiixp_clear_dma_packets(struct atiixp_modem *chip, struct atiixp_dma *dma, struct snd_pcm_substream *substream) atiixp_clear_dma_packets() argument
H A Des1938.c461 struct snd_pcm_substream *substream, snd_es1938_rate_set()
465 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_rate_set()
531 static int snd_es1938_capture_trigger(struct snd_pcm_substream *substream, snd_es1938_capture_trigger() argument
534 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_trigger()
554 static int snd_es1938_playback1_trigger(struct snd_pcm_substream *substream, snd_es1938_playback1_trigger() argument
557 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback1_trigger()
584 static int snd_es1938_playback2_trigger(struct snd_pcm_substream *substream, snd_es1938_playback2_trigger() argument
587 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback2_trigger()
607 static int snd_es1938_playback_trigger(struct snd_pcm_substream *substream, snd_es1938_playback_trigger() argument
610 switch (substream->number) { snd_es1938_playback_trigger()
612 return snd_es1938_playback1_trigger(substream, cmd); snd_es1938_playback_trigger()
614 return snd_es1938_playback2_trigger(substream, cmd); snd_es1938_playback_trigger()
623 static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream) snd_es1938_capture_prepare() argument
625 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_prepare()
626 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_prepare()
628 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es1938_capture_prepare()
629 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es1938_capture_prepare()
646 snd_es1938_rate_set(chip, substream, ADC1); snd_es1938_capture_prepare()
671 static int snd_es1938_playback1_prepare(struct snd_pcm_substream *substream) snd_es1938_playback1_prepare() argument
673 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback1_prepare()
674 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback1_prepare()
676 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es1938_playback1_prepare()
677 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es1938_playback1_prepare()
691 snd_es1938_rate_set(chip, substream, DAC2); snd_es1938_playback1_prepare()
708 static int snd_es1938_playback2_prepare(struct snd_pcm_substream *substream) snd_es1938_playback2_prepare() argument
710 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback2_prepare()
711 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback2_prepare()
713 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es1938_playback2_prepare()
714 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es1938_playback2_prepare()
733 snd_es1938_rate_set(chip, substream, DAC1); snd_es1938_playback2_prepare()
750 static int snd_es1938_playback_prepare(struct snd_pcm_substream *substream) snd_es1938_playback_prepare() argument
752 switch (substream->number) { snd_es1938_playback_prepare()
754 return snd_es1938_playback1_prepare(substream); snd_es1938_playback_prepare()
756 return snd_es1938_playback2_prepare(substream); snd_es1938_playback_prepare()
770 static snd_pcm_uframes_t snd_es1938_capture_pointer(struct snd_pcm_substream *substream) snd_es1938_capture_pointer() argument
772 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_pointer()
800 static snd_pcm_uframes_t snd_es1938_playback1_pointer(struct snd_pcm_substream *substream) snd_es1938_playback1_pointer() argument
802 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback1_pointer()
812 static snd_pcm_uframes_t snd_es1938_playback2_pointer(struct snd_pcm_substream *substream) snd_es1938_playback2_pointer() argument
814 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback2_pointer()
829 static snd_pcm_uframes_t snd_es1938_playback_pointer(struct snd_pcm_substream *substream) snd_es1938_playback_pointer() argument
831 switch (substream->number) { snd_es1938_playback_pointer()
833 return snd_es1938_playback1_pointer(substream); snd_es1938_playback_pointer()
835 return snd_es1938_playback2_pointer(substream); snd_es1938_playback_pointer()
841 static int snd_es1938_capture_copy(struct snd_pcm_substream *substream, snd_es1938_capture_copy() argument
847 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_copy()
848 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_copy()
868 static int snd_es1938_pcm_hw_params(struct snd_pcm_substream *substream, snd_es1938_pcm_hw_params() argument
874 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_es1938_pcm_hw_params()
879 static int snd_es1938_pcm_hw_free(struct snd_pcm_substream *substream) snd_es1938_pcm_hw_free() argument
881 return snd_pcm_lib_free_pages(substream); snd_es1938_pcm_hw_free()
929 static int snd_es1938_capture_open(struct snd_pcm_substream *substream) snd_es1938_capture_open() argument
931 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_open()
932 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_capture_open()
936 chip->capture_substream = substream; snd_es1938_capture_open()
944 static int snd_es1938_playback_open(struct snd_pcm_substream *substream) snd_es1938_playback_open() argument
946 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback_open()
947 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1938_playback_open()
949 switch (substream->number) { snd_es1938_playback_open()
951 chip->playback1_substream = substream; snd_es1938_playback_open()
956 chip->playback2_substream = substream; snd_es1938_playback_open()
969 static int snd_es1938_capture_close(struct snd_pcm_substream *substream) snd_es1938_capture_close() argument
971 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_capture_close()
977 static int snd_es1938_playback_close(struct snd_pcm_substream *substream) snd_es1938_playback_close() argument
979 struct es1938 *chip = snd_pcm_substream_chip(substream); snd_es1938_playback_close()
981 switch (substream->number) { snd_es1938_playback_close()
460 snd_es1938_rate_set(struct es1938 *chip, struct snd_pcm_substream *substream, int mode) snd_es1938_rate_set() argument
H A Dvia82xx_modem.c223 struct snd_pcm_substream *substream; member in struct:viadev
278 static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substream, build_via_table() argument
283 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); build_via_table()
318 addr = snd_pcm_sgbuf_get_addr(substream, ofs); build_via_table()
350 static int clean_via_table(struct viadev *dev, struct snd_pcm_substream *substream, clean_via_table() argument
503 if (viadev->substream && viadev->running) { snd_via82xx_interrupt()
505 snd_pcm_period_elapsed(viadev->substream); snd_via82xx_interrupt()
521 static int snd_via82xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_via82xx_pcm_trigger() argument
523 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_pcm_trigger()
524 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_trigger()
618 static snd_pcm_uframes_t snd_via686_pcm_pointer(struct snd_pcm_substream *substream) snd_via686_pcm_pointer() argument
620 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via686_pcm_pointer()
621 struct viadev *viadev = substream->runtime->private_data; snd_via686_pcm_pointer()
643 return bytes_to_frames(substream->runtime, res); snd_via686_pcm_pointer()
650 static int snd_via82xx_hw_params(struct snd_pcm_substream *substream, snd_via82xx_hw_params() argument
653 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_hw_params()
654 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_params()
657 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_via82xx_hw_params()
660 err = build_via_table(viadev, substream, chip->pci, snd_via82xx_hw_params()
676 static int snd_via82xx_hw_free(struct snd_pcm_substream *substream) snd_via82xx_hw_free() argument
678 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_hw_free()
679 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_free()
681 clean_via_table(viadev, substream, chip->pci); snd_via82xx_hw_free()
682 snd_pcm_lib_free_pages(substream); snd_via82xx_hw_free()
701 static int snd_via82xx_pcm_prepare(struct snd_pcm_substream *substream) snd_via82xx_pcm_prepare() argument
703 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_pcm_prepare()
704 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_prepare()
743 struct snd_pcm_substream *substream) snd_via82xx_modem_pcm_open()
745 struct snd_pcm_runtime *runtime = substream->runtime; snd_via82xx_modem_pcm_open()
766 viadev->substream = substream; snd_via82xx_modem_pcm_open()
775 static int snd_via82xx_playback_open(struct snd_pcm_substream *substream) snd_via82xx_playback_open() argument
777 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_playback_open()
778 struct viadev *viadev = &chip->devs[chip->playback_devno + substream->number]; snd_via82xx_playback_open()
780 return snd_via82xx_modem_pcm_open(chip, viadev, substream); snd_via82xx_playback_open()
786 static int snd_via82xx_capture_open(struct snd_pcm_substream *substream) snd_via82xx_capture_open() argument
788 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); snd_via82xx_capture_open()
789 struct viadev *viadev = &chip->devs[chip->capture_devno + substream->pcm->device]; snd_via82xx_capture_open()
791 return snd_via82xx_modem_pcm_open(chip, viadev, substream); snd_via82xx_capture_open()
797 static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream) snd_via82xx_pcm_close() argument
799 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_close()
801 viadev->substream = NULL; snd_via82xx_pcm_close()
742 snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev *viadev, struct snd_pcm_substream *substream) snd_via82xx_modem_pcm_open() argument
H A Dens1370.c810 static int snd_ensoniq_trigger(struct snd_pcm_substream *substream, int cmd) snd_ensoniq_trigger() argument
812 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_trigger()
819 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
822 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
825 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
843 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
846 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
849 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
852 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
874 static int snd_ensoniq_hw_params(struct snd_pcm_substream *substream, snd_ensoniq_hw_params() argument
877 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ensoniq_hw_params()
880 static int snd_ensoniq_hw_free(struct snd_pcm_substream *substream) snd_ensoniq_hw_free() argument
882 return snd_pcm_lib_free_pages(substream); snd_ensoniq_hw_free()
885 static int snd_ensoniq_playback1_prepare(struct snd_pcm_substream *substream) snd_ensoniq_playback1_prepare() argument
887 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback1_prepare()
888 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback1_prepare()
891 ensoniq->p1_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_ensoniq_playback1_prepare()
892 ensoniq->p1_period_size = snd_pcm_lib_period_bytes(substream); snd_ensoniq_playback1_prepare()
933 static int snd_ensoniq_playback2_prepare(struct snd_pcm_substream *substream) snd_ensoniq_playback2_prepare() argument
935 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback2_prepare()
936 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback2_prepare()
939 ensoniq->p2_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_ensoniq_playback2_prepare()
940 ensoniq->p2_period_size = snd_pcm_lib_period_bytes(substream); snd_ensoniq_playback2_prepare()
973 static int snd_ensoniq_capture_prepare(struct snd_pcm_substream *substream) snd_ensoniq_capture_prepare() argument
975 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_capture_prepare()
976 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_capture_prepare()
979 ensoniq->c_dma_size = snd_pcm_lib_buffer_bytes(substream); snd_ensoniq_capture_prepare()
980 ensoniq->c_period_size = snd_pcm_lib_period_bytes(substream); snd_ensoniq_capture_prepare()
1011 static snd_pcm_uframes_t snd_ensoniq_playback1_pointer(struct snd_pcm_substream *substream) snd_ensoniq_playback1_pointer() argument
1013 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback1_pointer()
1020 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_playback1_pointer()
1028 static snd_pcm_uframes_t snd_ensoniq_playback2_pointer(struct snd_pcm_substream *substream) snd_ensoniq_playback2_pointer() argument
1030 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback2_pointer()
1037 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_playback2_pointer()
1045 static snd_pcm_uframes_t snd_ensoniq_capture_pointer(struct snd_pcm_substream *substream) snd_ensoniq_capture_pointer() argument
1047 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_capture_pointer()
1054 ptr = bytes_to_frames(substream->runtime, ptr); snd_ensoniq_capture_pointer()
1128 static int snd_ensoniq_playback1_open(struct snd_pcm_substream *substream) snd_ensoniq_playback1_open() argument
1130 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback1_open()
1131 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback1_open()
1134 ensoniq->playback1_substream = substream; snd_ensoniq_playback1_open()
1136 snd_pcm_set_sync(substream); snd_ensoniq_playback1_open()
1151 static int snd_ensoniq_playback2_open(struct snd_pcm_substream *substream) snd_ensoniq_playback2_open() argument
1153 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback2_open()
1154 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_playback2_open()
1157 ensoniq->playback2_substream = substream; snd_ensoniq_playback2_open()
1159 snd_pcm_set_sync(substream); snd_ensoniq_playback2_open()
1174 static int snd_ensoniq_capture_open(struct snd_pcm_substream *substream) snd_ensoniq_capture_open() argument
1176 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_capture_open()
1177 struct snd_pcm_runtime *runtime = substream->runtime; snd_ensoniq_capture_open()
1180 ensoniq->capture_substream = substream; snd_ensoniq_capture_open()
1182 snd_pcm_set_sync(substream); snd_ensoniq_capture_open()
1193 static int snd_ensoniq_playback1_close(struct snd_pcm_substream *substream) snd_ensoniq_playback1_close() argument
1195 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback1_close()
1202 static int snd_ensoniq_playback2_close(struct snd_pcm_substream *substream) snd_ensoniq_playback2_close() argument
1204 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_playback2_close()
1216 static int snd_ensoniq_capture_close(struct snd_pcm_substream *substream) snd_ensoniq_capture_close() argument
1218 struct ensoniq *ensoniq = snd_pcm_substream_chip(substream); snd_ensoniq_capture_close()
2200 static int snd_ensoniq_midi_input_open(struct snd_rawmidi_substream *substream) snd_ensoniq_midi_input_open() argument
2202 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_input_open()
2206 ensoniq->midi_input = substream; snd_ensoniq_midi_input_open()
2216 static int snd_ensoniq_midi_input_close(struct snd_rawmidi_substream *substream) snd_ensoniq_midi_input_close() argument
2218 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_input_close()
2233 static int snd_ensoniq_midi_output_open(struct snd_rawmidi_substream *substream) snd_ensoniq_midi_output_open() argument
2235 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_output_open()
2239 ensoniq->midi_output = substream; snd_ensoniq_midi_output_open()
2249 static int snd_ensoniq_midi_output_close(struct snd_rawmidi_substream *substream) snd_ensoniq_midi_output_close() argument
2251 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_output_close()
2266 static void snd_ensoniq_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_ensoniq_midi_input_trigger() argument
2269 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_input_trigger()
2290 static void snd_ensoniq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_ensoniq_midi_output_trigger() argument
2293 struct ensoniq *ensoniq = substream->rmidi->private_data; snd_ensoniq_midi_output_trigger()
2303 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_ensoniq_midi_output_trigger()
H A Dintel8x0.c353 #define get_ichdev(substream) (substream->runtime->private_data)
360 struct snd_pcm_substream *substream; member in struct:ichdev
803 if (ack && ichdev->substream) { snd_intel8x0_update()
804 snd_pcm_period_elapsed(ichdev->substream); snd_intel8x0_update()
847 static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_intel8x0_pcm_trigger() argument
849 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_pcm_trigger()
850 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_pcm_trigger()
885 static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd) snd_intel8x0_ali_trigger() argument
887 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_ali_trigger()
888 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_ali_trigger()
902 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_intel8x0_ali_trigger()
940 static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream, snd_intel8x0_hw_params() argument
943 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_hw_params()
944 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_hw_params()
945 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_hw_params()
953 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_intel8x0_hw_params()
979 static int snd_intel8x0_hw_free(struct snd_pcm_substream *substream) snd_intel8x0_hw_free() argument
981 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_hw_free()
982 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_hw_free()
989 fill_nocache(substream->runtime->dma_area, substream->runtime->dma_bytes, 0); snd_intel8x0_hw_free()
992 return snd_pcm_lib_free_pages(substream); snd_intel8x0_hw_free()
1050 static int snd_intel8x0_pcm_prepare(struct snd_pcm_substream *substream) snd_intel8x0_pcm_prepare() argument
1052 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_pcm_prepare()
1053 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_pcm_prepare()
1054 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_pcm_prepare()
1057 ichdev->size = snd_pcm_lib_buffer_bytes(substream); snd_intel8x0_pcm_prepare()
1058 ichdev->fragsize = snd_pcm_lib_period_bytes(substream); snd_intel8x0_pcm_prepare()
1068 static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *substream) snd_intel8x0_pcm_pointer() argument
1070 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_pcm_pointer()
1071 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0_pcm_pointer()
1119 return bytes_to_frames(substream->runtime, ptr); snd_intel8x0_pcm_pointer()
1173 static int snd_intel8x0_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev) snd_intel8x0_pcm_open() argument
1175 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_pcm_open()
1176 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_pcm_open()
1179 ichdev->substream = substream; snd_intel8x0_pcm_open()
1193 static int snd_intel8x0_playback_open(struct snd_pcm_substream *substream) snd_intel8x0_playback_open() argument
1195 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_playback_open()
1196 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0_playback_open()
1199 err = snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMOUT]); snd_intel8x0_playback_open()
1227 static int snd_intel8x0_playback_close(struct snd_pcm_substream *substream) snd_intel8x0_playback_close() argument
1229 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_playback_close()
1231 chip->ichd[ICHD_PCMOUT].substream = NULL; snd_intel8x0_playback_close()
1235 static int snd_intel8x0_capture_open(struct snd_pcm_substream *substream) snd_intel8x0_capture_open() argument
1237 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_capture_open()
1239 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMIN]); snd_intel8x0_capture_open()
1242 static int snd_intel8x0_capture_close(struct snd_pcm_substream *substream) snd_intel8x0_capture_close() argument
1244 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_capture_close()
1246 chip->ichd[ICHD_PCMIN].substream = NULL; snd_intel8x0_capture_close()
1250 static int snd_intel8x0_mic_open(struct snd_pcm_substream *substream) snd_intel8x0_mic_open() argument
1252 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_mic_open()
1254 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC]); snd_intel8x0_mic_open()
1257 static int snd_intel8x0_mic_close(struct snd_pcm_substream *substream) snd_intel8x0_mic_close() argument
1259 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_mic_close()
1261 chip->ichd[ICHD_MIC].substream = NULL; snd_intel8x0_mic_close()
1265 static int snd_intel8x0_mic2_open(struct snd_pcm_substream *substream) snd_intel8x0_mic2_open() argument
1267 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_mic2_open()
1269 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC2]); snd_intel8x0_mic2_open()
1272 static int snd_intel8x0_mic2_close(struct snd_pcm_substream *substream) snd_intel8x0_mic2_close() argument
1274 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_mic2_close()
1276 chip->ichd[ICHD_MIC2].substream = NULL; snd_intel8x0_mic2_close()
1280 static int snd_intel8x0_capture2_open(struct snd_pcm_substream *substream) snd_intel8x0_capture2_open() argument
1282 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_capture2_open()
1284 return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCM2IN]); snd_intel8x0_capture2_open()
1287 static int snd_intel8x0_capture2_close(struct snd_pcm_substream *substream) snd_intel8x0_capture2_close() argument
1289 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_capture2_close()
1291 chip->ichd[ICHD_PCM2IN].substream = NULL; snd_intel8x0_capture2_close()
1295 static int snd_intel8x0_spdif_open(struct snd_pcm_substream *substream) snd_intel8x0_spdif_open() argument
1297 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_spdif_open()
1300 return snd_intel8x0_pcm_open(substream, &chip->ichd[idx]); snd_intel8x0_spdif_open()
1303 static int snd_intel8x0_spdif_close(struct snd_pcm_substream *substream) snd_intel8x0_spdif_close() argument
1305 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_spdif_close()
1308 chip->ichd[idx].substream = NULL; snd_intel8x0_spdif_close()
1312 static int snd_intel8x0_ali_ac97spdifout_open(struct snd_pcm_substream *substream) snd_intel8x0_ali_ac97spdifout_open() argument
1314 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_ali_ac97spdifout_open()
1324 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_AC97SPDIFOUT]); snd_intel8x0_ali_ac97spdifout_open()
1327 static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substream) snd_intel8x0_ali_ac97spdifout_close() argument
1329 struct intel8x0 *chip = snd_pcm_substream_chip(substream); snd_intel8x0_ali_ac97spdifout_close()
1332 chip->ichd[ALID_AC97SPDIFOUT].substream = NULL; snd_intel8x0_ali_ac97spdifout_close()
1343 static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
1345 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1347 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFIN]);
1350 static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream)
1352 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1354 chip->ichd[ALID_SPDIFIN].substream = NULL;
1358 static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream)
1360 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1362 return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFOUT]);
1365 static int snd_intel8x0_ali_spdifout_close(struct snd_pcm_substream *substream)
1367 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
1369 chip->ichd[ALID_SPDIFOUT].substream = NULL;
2668 if (ichdev->substream && ichdev->page_attr_changed) { intel8x0_suspend()
2669 struct snd_pcm_runtime *runtime = ichdev->substream->runtime; intel8x0_suspend()
2726 if (ichdev->substream && ichdev->page_attr_changed) { intel8x0_resume()
2727 struct snd_pcm_runtime *runtime = ichdev->substream->runtime; intel8x0_resume()
2738 if (! ichdev->substream || ! ichdev->suspended) intel8x0_resume()
2741 snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime); intel8x0_resume()
2773 subs = chip->pcm[0]->streams[0].substream; intel8x0_measure_ac97_clock()
2782 ichdev->substream = NULL; /* don't process interrupts */ intel8x0_measure_ac97_clock()
H A Dals4000.c371 static int snd_als4000_hw_params(struct snd_pcm_substream *substream, snd_als4000_hw_params() argument
374 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_als4000_hw_params()
377 static int snd_als4000_hw_free(struct snd_pcm_substream *substream) snd_als4000_hw_free() argument
379 snd_pcm_lib_free_pages(substream); snd_als4000_hw_free()
383 static int snd_als4000_capture_prepare(struct snd_pcm_substream *substream) snd_als4000_capture_prepare() argument
385 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_capture_prepare()
386 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_capture_prepare()
392 size = snd_pcm_lib_buffer_bytes(substream); snd_als4000_capture_prepare()
393 count = snd_pcm_lib_period_bytes(substream); snd_als4000_capture_prepare()
410 static int snd_als4000_playback_prepare(struct snd_pcm_substream *substream) snd_als4000_playback_prepare() argument
412 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_playback_prepare()
413 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_playback_prepare()
419 size = snd_pcm_lib_buffer_bytes(substream); snd_als4000_playback_prepare()
420 count = snd_pcm_lib_period_bytes(substream); snd_als4000_playback_prepare()
448 static int snd_als4000_capture_trigger(struct snd_pcm_substream *substream, int cmd) snd_als4000_capture_trigger() argument
450 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_capture_trigger()
481 static int snd_als4000_playback_trigger(struct snd_pcm_substream *substream, int cmd) snd_als4000_playback_trigger() argument
483 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_playback_trigger()
506 static snd_pcm_uframes_t snd_als4000_capture_pointer(struct snd_pcm_substream *substream) snd_als4000_capture_pointer() argument
508 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_capture_pointer()
515 return bytes_to_frames( substream->runtime, result ); snd_als4000_capture_pointer()
518 static snd_pcm_uframes_t snd_als4000_playback_pointer(struct snd_pcm_substream *substream) snd_als4000_playback_pointer() argument
520 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_playback_pointer()
527 return bytes_to_frames( substream->runtime, result ); snd_als4000_playback_pointer()
635 static int snd_als4000_playback_open(struct snd_pcm_substream *substream) snd_als4000_playback_open() argument
637 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_playback_open()
638 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_playback_open()
640 chip->playback_substream = substream; snd_als4000_playback_open()
645 static int snd_als4000_playback_close(struct snd_pcm_substream *substream) snd_als4000_playback_close() argument
647 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_playback_close()
650 snd_pcm_lib_free_pages(substream); snd_als4000_playback_close()
654 static int snd_als4000_capture_open(struct snd_pcm_substream *substream) snd_als4000_capture_open() argument
656 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_capture_open()
657 struct snd_pcm_runtime *runtime = substream->runtime; snd_als4000_capture_open()
659 chip->capture_substream = substream; snd_als4000_capture_open()
664 static int snd_als4000_capture_close(struct snd_pcm_substream *substream) snd_als4000_capture_close() argument
666 struct snd_sb *chip = snd_pcm_substream_chip(substream); snd_als4000_capture_close()
669 snd_pcm_lib_free_pages(substream); snd_als4000_capture_close()
H A Dintel8x0m.c166 #define get_ichdev(substream) (substream->runtime->private_data)
173 struct snd_pcm_substream *substream; member in struct:ichdev
491 if (ack && ichdev->substream) { snd_intel8x0m_update()
493 snd_pcm_period_elapsed(ichdev->substream); snd_intel8x0m_update()
536 static int snd_intel8x0m_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_intel8x0m_pcm_trigger() argument
538 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_pcm_trigger()
539 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0m_pcm_trigger()
571 static int snd_intel8x0m_hw_params(struct snd_pcm_substream *substream, snd_intel8x0m_hw_params() argument
574 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_intel8x0m_hw_params()
577 static int snd_intel8x0m_hw_free(struct snd_pcm_substream *substream) snd_intel8x0m_hw_free() argument
579 return snd_pcm_lib_free_pages(substream); snd_intel8x0m_hw_free()
582 static snd_pcm_uframes_t snd_intel8x0m_pcm_pointer(struct snd_pcm_substream *substream) snd_intel8x0m_pcm_pointer() argument
584 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_pcm_pointer()
585 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0m_pcm_pointer()
596 return bytes_to_frames(substream->runtime, ptr); snd_intel8x0m_pcm_pointer()
599 static int snd_intel8x0m_pcm_prepare(struct snd_pcm_substream *substream) snd_intel8x0m_pcm_prepare() argument
601 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_pcm_prepare()
602 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0m_pcm_prepare()
603 struct ichdev *ichdev = get_ichdev(substream); snd_intel8x0m_pcm_prepare()
606 ichdev->size = snd_pcm_lib_buffer_bytes(substream); snd_intel8x0m_pcm_prepare()
607 ichdev->fragsize = snd_pcm_lib_period_bytes(substream); snd_intel8x0m_pcm_prepare()
636 static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev) snd_intel8x0m_pcm_open() argument
644 struct snd_pcm_runtime *runtime = substream->runtime; snd_intel8x0m_pcm_open()
647 ichdev->substream = substream; snd_intel8x0m_pcm_open()
657 static int snd_intel8x0m_playback_open(struct snd_pcm_substream *substream) snd_intel8x0m_playback_open() argument
659 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_playback_open()
661 return snd_intel8x0m_pcm_open(substream, &chip->ichd[ICHD_MDMOUT]); snd_intel8x0m_playback_open()
664 static int snd_intel8x0m_playback_close(struct snd_pcm_substream *substream) snd_intel8x0m_playback_close() argument
666 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_playback_close()
668 chip->ichd[ICHD_MDMOUT].substream = NULL; snd_intel8x0m_playback_close()
672 static int snd_intel8x0m_capture_open(struct snd_pcm_substream *substream) snd_intel8x0m_capture_open() argument
674 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_capture_open()
676 return snd_intel8x0m_pcm_open(substream, &chip->ichd[ICHD_MDMIN]); snd_intel8x0m_capture_open()
679 static int snd_intel8x0m_capture_close(struct snd_pcm_substream *substream) snd_intel8x0m_capture_close() argument
681 struct intel8x0m *chip = snd_pcm_substream_chip(substream); snd_intel8x0m_capture_close()
683 chip->ichd[ICHD_MDMIN].substream = NULL; snd_intel8x0m_capture_close()
H A Dfm801.c364 static int snd_fm801_playback_trigger(struct snd_pcm_substream *substream, snd_fm801_playback_trigger() argument
367 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_playback_trigger()
399 static int snd_fm801_capture_trigger(struct snd_pcm_substream *substream, snd_fm801_capture_trigger() argument
402 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_capture_trigger()
434 static int snd_fm801_hw_params(struct snd_pcm_substream *substream, snd_fm801_hw_params() argument
437 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_fm801_hw_params()
440 static int snd_fm801_hw_free(struct snd_pcm_substream *substream) snd_fm801_hw_free() argument
442 return snd_pcm_lib_free_pages(substream); snd_fm801_hw_free()
445 static int snd_fm801_playback_prepare(struct snd_pcm_substream *substream) snd_fm801_playback_prepare() argument
447 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_playback_prepare()
448 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_playback_prepare()
450 chip->ply_size = snd_pcm_lib_buffer_bytes(substream); snd_fm801_playback_prepare()
451 chip->ply_count = snd_pcm_lib_period_bytes(substream); snd_fm801_playback_prepare()
478 static int snd_fm801_capture_prepare(struct snd_pcm_substream *substream) snd_fm801_capture_prepare() argument
480 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_capture_prepare()
481 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_capture_prepare()
483 chip->cap_size = snd_pcm_lib_buffer_bytes(substream); snd_fm801_capture_prepare()
484 chip->cap_count = snd_pcm_lib_period_bytes(substream); snd_fm801_capture_prepare()
505 static snd_pcm_uframes_t snd_fm801_playback_pointer(struct snd_pcm_substream *substream) snd_fm801_playback_pointer() argument
507 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_playback_pointer()
519 return bytes_to_frames(substream->runtime, ptr); snd_fm801_playback_pointer()
522 static snd_pcm_uframes_t snd_fm801_capture_pointer(struct snd_pcm_substream *substream) snd_fm801_capture_pointer() argument
524 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_capture_pointer()
536 return bytes_to_frames(substream->runtime, ptr); snd_fm801_capture_pointer()
627 static int snd_fm801_playback_open(struct snd_pcm_substream *substream) snd_fm801_playback_open() argument
629 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_playback_open()
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_playback_open()
633 chip->playback_substream = substream; snd_fm801_playback_open()
648 static int snd_fm801_capture_open(struct snd_pcm_substream *substream) snd_fm801_capture_open() argument
650 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_capture_open()
651 struct snd_pcm_runtime *runtime = substream->runtime; snd_fm801_capture_open()
654 chip->capture_substream = substream; snd_fm801_capture_open()
663 static int snd_fm801_playback_close(struct snd_pcm_substream *substream) snd_fm801_playback_close() argument
665 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_playback_close()
671 static int snd_fm801_capture_close(struct snd_pcm_substream *substream) snd_fm801_capture_close() argument
673 struct fm801 *chip = snd_pcm_substream_chip(substream); snd_fm801_capture_close()
H A Dsis7019.c94 struct snd_pcm_substream *substream; member in struct:voice
293 snd_pcm_period_elapsed(voice->substream); sis_update_voice()
345 snd_pcm_period_elapsed(voice->substream); sis_interrupt()
447 static int sis_alloc_timing_voice(struct snd_pcm_substream *substream, sis_alloc_timing_voice() argument
450 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_alloc_timing_voice()
451 struct snd_pcm_runtime *runtime = substream->runtime; sis_alloc_timing_voice()
474 voice->timing->substream = substream; sis_alloc_timing_voice()
483 static int sis_playback_open(struct snd_pcm_substream *substream) sis_playback_open() argument
485 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_playback_open()
486 struct snd_pcm_runtime *runtime = substream->runtime; sis_playback_open()
493 voice->substream = substream; sis_playback_open()
500 snd_pcm_set_sync(substream); sis_playback_open()
504 static int sis_substream_close(struct snd_pcm_substream *substream) sis_substream_close() argument
506 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_substream_close()
507 struct snd_pcm_runtime *runtime = substream->runtime; sis_substream_close()
514 static int sis_playback_hw_params(struct snd_pcm_substream *substream, sis_playback_hw_params() argument
517 return snd_pcm_lib_malloc_pages(substream, sis_playback_hw_params()
521 static int sis_hw_free(struct snd_pcm_substream *substream) sis_hw_free() argument
523 return snd_pcm_lib_free_pages(substream); sis_hw_free()
526 static int sis_pcm_playback_prepare(struct snd_pcm_substream *substream) sis_pcm_playback_prepare() argument
528 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_playback_prepare()
536 * substream do not change on us while we're programming the HW. sis_pcm_playback_prepare()
592 static int sis_pcm_trigger(struct snd_pcm_substream *substream, int cmd) sis_pcm_trigger() argument
594 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_pcm_trigger()
622 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
640 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
661 static snd_pcm_uframes_t sis_pcm_pointer(struct snd_pcm_substream *substream) sis_pcm_pointer() argument
663 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_pointer()
672 static int sis_capture_open(struct snd_pcm_substream *substream) sis_capture_open() argument
674 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_capture_open()
675 struct snd_pcm_runtime *runtime = substream->runtime; sis_capture_open()
692 voice->substream = substream; sis_capture_open()
701 snd_pcm_set_sync(substream); sis_capture_open()
705 static int sis_capture_hw_params(struct snd_pcm_substream *substream, sis_capture_hw_params() argument
708 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_capture_hw_params()
716 rc = snd_pcm_lib_malloc_pages(substream, sis_capture_hw_params()
721 rc = sis_alloc_timing_voice(substream, hw_params); sis_capture_hw_params()
728 struct snd_pcm_substream *substream) sis_prepare_timing_voice()
730 struct sis7019 *sis = snd_pcm_substream_chip(substream); sis_prepare_timing_voice()
731 struct snd_pcm_runtime *runtime = substream->runtime; sis_prepare_timing_voice()
830 static int sis_pcm_capture_prepare(struct snd_pcm_substream *substream) sis_pcm_capture_prepare() argument
832 struct snd_pcm_runtime *runtime = substream->runtime; sis_pcm_capture_prepare()
839 * substream do not change on us while we're programming the HW. sis_pcm_capture_prepare()
858 sis_prepare_timing_voice(voice, substream); sis_pcm_capture_prepare()
727 sis_prepare_timing_voice(struct voice *voice, struct snd_pcm_substream *substream) sis_prepare_timing_voice() argument
H A Drme96.c286 snd_rme96_playback_prepare(struct snd_pcm_substream *substream);
289 snd_rme96_capture_prepare(struct snd_pcm_substream *substream);
292 snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
296 snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
300 snd_rme96_playback_pointer(struct snd_pcm_substream *substream);
303 snd_rme96_capture_pointer(struct snd_pcm_substream *substream);
329 snd_rme96_playback_silence(struct snd_pcm_substream *substream, snd_rme96_playback_silence() argument
334 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_silence()
343 snd_rme96_playback_copy(struct snd_pcm_substream *substream, snd_rme96_playback_copy() argument
349 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_copy()
357 snd_rme96_capture_copy(struct snd_pcm_substream *substream, snd_rme96_capture_copy() argument
363 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_copy()
978 snd_rme96_playback_hw_params(struct snd_pcm_substream *substream, snd_rme96_playback_hw_params() argument
981 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_hw_params()
982 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_hw_params()
1041 snd_rme96_capture_hw_params(struct snd_pcm_substream *substream, snd_rme96_capture_hw_params() argument
1044 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_hw_params()
1045 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_hw_params()
1180 snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream) snd_rme96_playback_spdif_open() argument
1183 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_spdif_open()
1184 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_spdif_open()
1186 snd_pcm_set_sync(substream); snd_rme96_playback_spdif_open()
1194 rme96->playback_substream = substream; snd_rme96_playback_spdif_open()
1217 snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream) snd_rme96_capture_spdif_open() argument
1220 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_spdif_open()
1221 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_spdif_open()
1223 snd_pcm_set_sync(substream); snd_rme96_capture_spdif_open()
1241 rme96->capture_substream = substream; snd_rme96_capture_spdif_open()
1249 snd_rme96_playback_adat_open(struct snd_pcm_substream *substream) snd_rme96_playback_adat_open() argument
1252 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_adat_open()
1253 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_playback_adat_open()
1255 snd_pcm_set_sync(substream); snd_rme96_playback_adat_open()
1263 rme96->playback_substream = substream; snd_rme96_playback_adat_open()
1281 snd_rme96_capture_adat_open(struct snd_pcm_substream *substream) snd_rme96_capture_adat_open() argument
1284 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_adat_open()
1285 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme96_capture_adat_open()
1287 snd_pcm_set_sync(substream); snd_rme96_capture_adat_open()
1308 rme96->capture_substream = substream; snd_rme96_capture_adat_open()
1316 snd_rme96_playback_close(struct snd_pcm_substream *substream) snd_rme96_playback_close() argument
1318 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_close()
1338 snd_rme96_capture_close(struct snd_pcm_substream *substream) snd_rme96_capture_close() argument
1340 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_close()
1353 snd_rme96_playback_prepare(struct snd_pcm_substream *substream) snd_rme96_playback_prepare() argument
1355 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_prepare()
1367 snd_rme96_capture_prepare(struct snd_pcm_substream *substream) snd_rme96_capture_prepare() argument
1369 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_prepare()
1381 snd_rme96_playback_trigger(struct snd_pcm_substream *substream, snd_rme96_playback_trigger() argument
1384 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_trigger()
1388 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1390 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1400 if (substream != rme96->playback_substream)
1410 if (substream != rme96->playback_substream)
1438 snd_rme96_capture_trigger(struct snd_pcm_substream *substream, snd_rme96_capture_trigger() argument
1441 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_trigger()
1445 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1447 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1457 if (substream != rme96->capture_substream)
1467 if (substream != rme96->capture_substream)
1495 snd_rme96_playback_pointer(struct snd_pcm_substream *substream) snd_rme96_playback_pointer() argument
1497 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_playback_pointer()
1502 snd_rme96_capture_pointer(struct snd_pcm_substream *substream) snd_rme96_capture_pointer() argument
1504 struct rme96 *rme96 = snd_pcm_substream_chip(substream); snd_rme96_capture_pointer()
H A Dcmipci.c433 struct snd_pcm_substream *substream; member in struct:cmipci_pcm
682 static int snd_cmipci_hw_params(struct snd_pcm_substream *substream, snd_cmipci_hw_params() argument
685 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_cmipci_hw_params()
688 static int snd_cmipci_playback2_hw_params(struct snd_pcm_substream *substream, snd_cmipci_playback2_hw_params() argument
691 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback2_hw_params()
702 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_cmipci_playback2_hw_params()
713 static int snd_cmipci_hw_free(struct snd_pcm_substream *substream) snd_cmipci_hw_free() argument
715 return snd_pcm_lib_free_pages(substream); snd_cmipci_hw_free()
783 struct snd_pcm_substream *substream) snd_cmipci_pcm_prepare()
787 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_pcm_prepare()
941 struct snd_pcm_substream *substream) snd_cmipci_pcm_pointer()
962 ptr = bytes_to_frames(substream->runtime, ptr); snd_cmipci_pcm_pointer()
964 if (substream->runtime->channels > 2) snd_cmipci_pcm_pointer()
965 ptr = (ptr * 2) / substream->runtime->channels; snd_cmipci_pcm_pointer()
973 static int snd_cmipci_playback_trigger(struct snd_pcm_substream *substream, snd_cmipci_playback_trigger() argument
976 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_trigger()
980 static snd_pcm_uframes_t snd_cmipci_playback_pointer(struct snd_pcm_substream *substream) snd_cmipci_playback_pointer() argument
982 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_pointer()
983 return snd_cmipci_pcm_pointer(cm, &cm->channel[CM_CH_PLAY], substream); snd_cmipci_playback_pointer()
992 static int snd_cmipci_capture_trigger(struct snd_pcm_substream *substream, snd_cmipci_capture_trigger() argument
995 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_trigger()
999 static snd_pcm_uframes_t snd_cmipci_capture_pointer(struct snd_pcm_substream *substream) snd_cmipci_capture_pointer() argument
1001 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_pointer()
1002 return snd_cmipci_pcm_pointer(cm, &cm->channel[CM_CH_CAPT], substream); snd_cmipci_capture_pointer()
1296 static int snd_cmipci_playback_prepare(struct snd_pcm_substream *substream) snd_cmipci_playback_prepare() argument
1298 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_prepare()
1299 int rate = substream->runtime->rate; snd_cmipci_playback_prepare()
1303 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE && snd_cmipci_playback_prepare()
1304 substream->runtime->channels == 2); snd_cmipci_playback_prepare()
1307 if ((err = setup_spdif_playback(cm, substream, do_spdif, do_ac3)) < 0) snd_cmipci_playback_prepare()
1309 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream); snd_cmipci_playback_prepare()
1313 static int snd_cmipci_playback_spdif_prepare(struct snd_pcm_substream *substream) snd_cmipci_playback_spdif_prepare() argument
1315 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_spdif_prepare()
1322 if ((err = setup_spdif_playback(cm, substream, 1, do_ac3)) < 0) snd_cmipci_playback_spdif_prepare()
1324 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream); snd_cmipci_playback_spdif_prepare()
1337 struct snd_pcm_runtime *runtime = rec->substream->runtime; snd_cmipci_silence_hack()
1381 static int snd_cmipci_playback_hw_free(struct snd_pcm_substream *substream) snd_cmipci_playback_hw_free() argument
1383 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_hw_free()
1384 setup_spdif_playback(cm, substream, 0, 0); snd_cmipci_playback_hw_free()
1387 return snd_cmipci_hw_free(substream); snd_cmipci_playback_hw_free()
1390 static int snd_cmipci_playback2_hw_free(struct snd_pcm_substream *substream) snd_cmipci_playback2_hw_free() argument
1392 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback2_hw_free()
1394 return snd_cmipci_hw_free(substream); snd_cmipci_playback2_hw_free()
1398 static int snd_cmipci_capture_prepare(struct snd_pcm_substream *substream) snd_cmipci_capture_prepare() argument
1400 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_prepare()
1401 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_CAPT], substream); snd_cmipci_capture_prepare()
1405 static int snd_cmipci_capture_spdif_prepare(struct snd_pcm_substream *substream) snd_cmipci_capture_spdif_prepare() argument
1407 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_spdif_prepare()
1412 if (substream->runtime->rate > 48000) snd_cmipci_capture_spdif_prepare()
1417 if (snd_pcm_format_width(substream->runtime->format) > 16) snd_cmipci_capture_spdif_prepare()
1424 return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_CAPT], substream); snd_cmipci_capture_spdif_prepare()
1468 snd_pcm_period_elapsed(cm->channel[0].substream); snd_cmipci_interrupt()
1470 snd_pcm_period_elapsed(cm->channel[1].substream); snd_cmipci_interrupt()
1626 cm->channel[ch].substream = subs; open_device_check()
1644 if (cm->channel[ch].substream) { close_device_check()
1647 cm->channel[ch].substream = NULL; close_device_check()
1664 static int snd_cmipci_playback_open(struct snd_pcm_substream *substream) snd_cmipci_playback_open() argument
1666 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_open()
1667 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback_open()
1670 if ((err = open_device_check(cm, CM_OPEN_PLAYBACK, substream)) < 0) snd_cmipci_playback_open()
1690 static int snd_cmipci_capture_open(struct snd_pcm_substream *substream) snd_cmipci_capture_open() argument
1692 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_open()
1693 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_capture_open()
1696 if ((err = open_device_check(cm, CM_OPEN_CAPTURE, substream)) < 0) snd_cmipci_capture_open()
1714 static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream) snd_cmipci_playback2_open() argument
1716 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback2_open()
1717 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback2_open()
1720 if ((err = open_device_check(cm, CM_OPEN_PLAYBACK2, substream)) < 0) /* use channel B */ snd_cmipci_playback2_open()
1752 static int snd_cmipci_playback_spdif_open(struct snd_pcm_substream *substream) snd_cmipci_playback_spdif_open() argument
1754 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_spdif_open()
1755 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_playback_spdif_open()
1758 if ((err = open_device_check(cm, CM_OPEN_SPDIF_PLAYBACK, substream)) < 0) /* use channel A */ snd_cmipci_playback_spdif_open()
1779 static int snd_cmipci_capture_spdif_open(struct snd_pcm_substream *substream) snd_cmipci_capture_spdif_open() argument
1781 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_spdif_open()
1782 struct snd_pcm_runtime *runtime = substream->runtime; snd_cmipci_capture_spdif_open()
1785 if ((err = open_device_check(cm, CM_OPEN_SPDIF_CAPTURE, substream)) < 0) /* use channel B */ snd_cmipci_capture_spdif_open()
1801 static int snd_cmipci_playback_close(struct snd_pcm_substream *substream) snd_cmipci_playback_close() argument
1803 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_close()
1808 static int snd_cmipci_capture_close(struct snd_pcm_substream *substream) snd_cmipci_capture_close() argument
1810 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_close()
1815 static int snd_cmipci_playback2_close(struct snd_pcm_substream *substream) snd_cmipci_playback2_close() argument
1817 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback2_close()
1823 static int snd_cmipci_playback_spdif_close(struct snd_pcm_substream *substream) snd_cmipci_playback_spdif_close() argument
1825 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_playback_spdif_close()
1830 static int snd_cmipci_capture_spdif_close(struct snd_pcm_substream *substream) snd_cmipci_capture_spdif_close() argument
1832 struct cmipci *cm = snd_pcm_substream_chip(substream); snd_cmipci_capture_spdif_close()
782 snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec, struct snd_pcm_substream *substream) snd_cmipci_pcm_prepare() argument
940 snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci_pcm *rec, struct snd_pcm_substream *substream) snd_cmipci_pcm_pointer() argument
H A Dvia82xx.c328 struct snd_pcm_substream *substream; member in struct:viadev
425 static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substream, build_via_table() argument
430 struct via82xx *chip = snd_pcm_substream_chip(substream); build_via_table()
465 addr = snd_pcm_sgbuf_get_addr(substream, ofs); build_via_table()
467 r = snd_pcm_sgbuf_get_chunk_size(substream, ofs, rest); build_via_table()
496 static int clean_via_table(struct viadev *dev, struct snd_pcm_substream *substream, clean_via_table() argument
649 if (viadev->substream && viadev->running) { snd_via686_interrupt()
661 snd_pcm_period_elapsed(viadev->substream); snd_via686_interrupt()
687 struct snd_pcm_substream *substream; snd_via8233_interrupt() local
697 substream = viadev->substream; snd_via8233_interrupt()
698 if (substream && viadev->running) { snd_via8233_interrupt()
713 snd_pcm_period_elapsed(substream); snd_via8233_interrupt()
732 static int snd_via82xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_via82xx_pcm_trigger() argument
734 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via82xx_pcm_trigger()
735 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_trigger()
837 static snd_pcm_uframes_t snd_via686_pcm_pointer(struct snd_pcm_substream *substream) snd_via686_pcm_pointer() argument
839 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via686_pcm_pointer()
840 struct viadev *viadev = substream->runtime->private_data; snd_via686_pcm_pointer()
862 return bytes_to_frames(substream->runtime, res); snd_via686_pcm_pointer()
868 static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *substream) snd_via8233_pcm_pointer() argument
870 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_pcm_pointer()
871 struct viadev *viadev = substream->runtime->private_data; snd_via8233_pcm_pointer()
887 snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START); snd_via8233_pcm_pointer()
921 return bytes_to_frames(substream->runtime, res); snd_via8233_pcm_pointer()
929 static int snd_via82xx_hw_params(struct snd_pcm_substream *substream, snd_via82xx_hw_params() argument
932 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via82xx_hw_params()
933 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_params()
936 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_via82xx_hw_params()
939 err = build_via_table(viadev, substream, chip->pci, snd_via82xx_hw_params()
952 static int snd_via82xx_hw_free(struct snd_pcm_substream *substream) snd_via82xx_hw_free() argument
954 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via82xx_hw_free()
955 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_hw_free()
957 clean_via_table(viadev, substream, chip->pci); snd_via82xx_hw_free()
958 snd_pcm_lib_free_pages(substream); snd_via82xx_hw_free()
991 static int snd_via686_playback_prepare(struct snd_pcm_substream *substream) snd_via686_playback_prepare() argument
993 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via686_playback_prepare()
994 struct viadev *viadev = substream->runtime->private_data; snd_via686_playback_prepare()
995 struct snd_pcm_runtime *runtime = substream->runtime; snd_via686_playback_prepare()
1003 static int snd_via686_capture_prepare(struct snd_pcm_substream *substream) snd_via686_capture_prepare() argument
1005 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via686_capture_prepare()
1006 struct viadev *viadev = substream->runtime->private_data; snd_via686_capture_prepare()
1007 struct snd_pcm_runtime *runtime = substream->runtime; snd_via686_capture_prepare()
1037 static int snd_via8233_playback_prepare(struct snd_pcm_substream *substream) snd_via8233_playback_prepare() argument
1039 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_playback_prepare()
1040 struct viadev *viadev = substream->runtime->private_data; snd_via8233_playback_prepare()
1041 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_playback_prepare()
1079 static int snd_via8233_multi_prepare(struct snd_pcm_substream *substream) snd_via8233_multi_prepare() argument
1081 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_multi_prepare()
1082 struct viadev *viadev = substream->runtime->private_data; snd_via8233_multi_prepare()
1083 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_multi_prepare()
1128 static int snd_via8233_capture_prepare(struct snd_pcm_substream *substream) snd_via8233_capture_prepare() argument
1130 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_capture_prepare()
1131 struct viadev *viadev = substream->runtime->private_data; snd_via8233_capture_prepare()
1132 struct snd_pcm_runtime *runtime = substream->runtime; snd_via8233_capture_prepare()
1179 struct snd_pcm_substream *substream) snd_via82xx_pcm_open()
1181 struct snd_pcm_runtime *runtime = substream->runtime; snd_via82xx_pcm_open()
1230 viadev->substream = substream; snd_via82xx_pcm_open()
1239 static int snd_via686_playback_open(struct snd_pcm_substream *substream) snd_via686_playback_open() argument
1241 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via686_playback_open()
1242 struct viadev *viadev = &chip->devs[chip->playback_devno + substream->number]; snd_via686_playback_open()
1245 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) snd_via686_playback_open()
1253 static int snd_via8233_playback_open(struct snd_pcm_substream *substream) snd_via8233_playback_open() argument
1255 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_playback_open()
1260 viadev = &chip->devs[chip->playback_devno + substream->number]; snd_via8233_playback_open()
1261 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) snd_via8233_playback_open()
1281 static int snd_via8233_multi_open(struct snd_pcm_substream *substream) snd_via8233_multi_open() argument
1283 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_multi_open()
1298 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0) snd_via8233_multi_open()
1300 substream->runtime->hw.channels_max = 6; snd_via8233_multi_open()
1302 snd_pcm_hw_constraint_list(substream->runtime, 0, snd_via8233_multi_open()
1311 static int snd_via82xx_capture_open(struct snd_pcm_substream *substream) snd_via82xx_capture_open() argument
1313 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via82xx_capture_open()
1314 struct viadev *viadev = &chip->devs[chip->capture_devno + substream->pcm->device]; snd_via82xx_capture_open()
1316 return snd_via82xx_pcm_open(chip, viadev, substream); snd_via82xx_capture_open()
1322 static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream) snd_via82xx_pcm_close() argument
1324 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via82xx_pcm_close()
1325 struct viadev *viadev = substream->runtime->private_data; snd_via82xx_pcm_close()
1347 viadev->substream = NULL; snd_via82xx_pcm_close()
1351 static int snd_via8233_playback_close(struct snd_pcm_substream *substream) snd_via8233_playback_close() argument
1353 struct via82xx *chip = snd_pcm_substream_chip(substream); snd_via8233_playback_close()
1354 struct viadev *viadev = substream->runtime->private_data; snd_via8233_playback_close()
1364 return snd_via82xx_pcm_close(substream); snd_via8233_playback_close()
1178 snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev, struct snd_pcm_substream *substream) snd_via82xx_pcm_open() argument
H A Dbt87x.c201 struct snd_pcm_substream *substream; member in struct:snd_bt87x
227 static int snd_bt87x_create_risc(struct snd_bt87x *chip, struct snd_pcm_substream *substream, snd_bt87x_create_risc() argument
263 addr = snd_pcm_sgbuf_get_addr(substream, offset); snd_bt87x_create_risc()
351 snd_pcm_period_elapsed(chip->substream); snd_bt87x_interrupt()
421 static int snd_bt87x_pcm_open(struct snd_pcm_substream *substream) snd_bt87x_pcm_open() argument
423 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_pcm_open()
424 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_pcm_open()
430 if (substream->pcm->device == DEVICE_DIGITAL) snd_bt87x_pcm_open()
441 chip->substream = substream; snd_bt87x_pcm_open()
450 static int snd_bt87x_close(struct snd_pcm_substream *substream) snd_bt87x_close() argument
452 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_close()
459 chip->substream = NULL; snd_bt87x_close()
465 static int snd_bt87x_hw_params(struct snd_pcm_substream *substream, snd_bt87x_hw_params() argument
468 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_hw_params()
471 err = snd_pcm_lib_malloc_pages(substream, snd_bt87x_hw_params()
475 return snd_bt87x_create_risc(chip, substream, snd_bt87x_hw_params()
480 static int snd_bt87x_hw_free(struct snd_pcm_substream *substream) snd_bt87x_hw_free() argument
482 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_hw_free()
485 snd_pcm_lib_free_pages(substream); snd_bt87x_hw_free()
489 static int snd_bt87x_prepare(struct snd_pcm_substream *substream) snd_bt87x_prepare() argument
491 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_prepare()
492 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_prepare()
531 static int snd_bt87x_trigger(struct snd_pcm_substream *substream, int cmd) snd_bt87x_trigger() argument
533 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_trigger()
545 static snd_pcm_uframes_t snd_bt87x_pointer(struct snd_pcm_substream *substream) snd_bt87x_pointer() argument
547 struct snd_bt87x *chip = snd_pcm_substream_chip(substream); snd_bt87x_pointer()
548 struct snd_pcm_runtime *runtime = substream->runtime; snd_bt87x_pointer()
H A Dcs4281.c431 struct snd_pcm_substream *substream; member in struct:cs4281_dma
668 static int snd_cs4281_trigger(struct snd_pcm_substream *substream, int cmd) snd_cs4281_trigger() argument
670 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_trigger()
671 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_trigger()
799 static int snd_cs4281_hw_params(struct snd_pcm_substream *substream, snd_cs4281_hw_params() argument
802 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_cs4281_hw_params()
805 static int snd_cs4281_hw_free(struct snd_pcm_substream *substream) snd_cs4281_hw_free() argument
807 return snd_pcm_lib_free_pages(substream); snd_cs4281_hw_free()
810 static int snd_cs4281_playback_prepare(struct snd_pcm_substream *substream) snd_cs4281_playback_prepare() argument
812 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_playback_prepare()
814 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_playback_prepare()
822 static int snd_cs4281_capture_prepare(struct snd_pcm_substream *substream) snd_cs4281_capture_prepare() argument
824 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_capture_prepare()
826 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_capture_prepare()
834 static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream) snd_cs4281_pointer() argument
836 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_pointer()
838 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_pointer()
900 static int snd_cs4281_playback_open(struct snd_pcm_substream *substream) snd_cs4281_playback_open() argument
902 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_playback_open()
903 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_playback_open()
907 dma->substream = substream; snd_cs4281_playback_open()
919 static int snd_cs4281_capture_open(struct snd_pcm_substream *substream) snd_cs4281_capture_open() argument
921 struct cs4281 *chip = snd_pcm_substream_chip(substream); snd_cs4281_capture_open()
922 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4281_capture_open()
926 dma->substream = substream; snd_cs4281_capture_open()
938 static int snd_cs4281_playback_close(struct snd_pcm_substream *substream) snd_cs4281_playback_close() argument
940 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_playback_close()
942 dma->substream = NULL; snd_cs4281_playback_close()
946 static int snd_cs4281_capture_close(struct snd_pcm_substream *substream) snd_cs4281_capture_close() argument
948 struct cs4281_dma *dma = substream->runtime->private_data; snd_cs4281_capture_close()
950 dma->substream = NULL; snd_cs4281_capture_close()
1653 static int snd_cs4281_midi_input_open(struct snd_rawmidi_substream *substream) snd_cs4281_midi_input_open() argument
1655 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_input_open()
1659 chip->midi_input = substream; snd_cs4281_midi_input_open()
1669 static int snd_cs4281_midi_input_close(struct snd_rawmidi_substream *substream) snd_cs4281_midi_input_close() argument
1671 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_input_close()
1686 static int snd_cs4281_midi_output_open(struct snd_rawmidi_substream *substream) snd_cs4281_midi_output_open() argument
1688 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_output_open()
1693 chip->midi_output = substream; snd_cs4281_midi_output_open()
1703 static int snd_cs4281_midi_output_close(struct snd_rawmidi_substream *substream) snd_cs4281_midi_output_close() argument
1705 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_output_close()
1720 static void snd_cs4281_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_cs4281_midi_input_trigger() argument
1723 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_input_trigger()
1740 static void snd_cs4281_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_cs4281_midi_output_trigger() argument
1743 struct cs4281 *chip = substream->rmidi->private_data; snd_cs4281_midi_output_trigger()
1753 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_cs4281_midi_output_trigger()
1841 snd_pcm_period_elapsed(cdma->substream); snd_cs4281_interrupt()
H A Dsonicvibes.c684 static int snd_sonicvibes_playback_trigger(struct snd_pcm_substream *substream, snd_sonicvibes_playback_trigger() argument
687 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_playback_trigger()
691 static int snd_sonicvibes_capture_trigger(struct snd_pcm_substream *substream, snd_sonicvibes_capture_trigger() argument
694 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_capture_trigger()
698 static int snd_sonicvibes_hw_params(struct snd_pcm_substream *substream, snd_sonicvibes_hw_params() argument
701 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_sonicvibes_hw_params()
704 static int snd_sonicvibes_hw_free(struct snd_pcm_substream *substream) snd_sonicvibes_hw_free() argument
706 return snd_pcm_lib_free_pages(substream); snd_sonicvibes_hw_free()
709 static int snd_sonicvibes_playback_prepare(struct snd_pcm_substream *substream) snd_sonicvibes_playback_prepare() argument
711 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_playback_prepare()
712 struct snd_pcm_runtime *runtime = substream->runtime; snd_sonicvibes_playback_prepare()
714 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_sonicvibes_playback_prepare()
715 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_sonicvibes_playback_prepare()
733 static int snd_sonicvibes_capture_prepare(struct snd_pcm_substream *substream) snd_sonicvibes_capture_prepare() argument
735 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_capture_prepare()
736 struct snd_pcm_runtime *runtime = substream->runtime; snd_sonicvibes_capture_prepare()
738 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_sonicvibes_capture_prepare()
739 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_sonicvibes_capture_prepare()
758 static snd_pcm_uframes_t snd_sonicvibes_playback_pointer(struct snd_pcm_substream *substream) snd_sonicvibes_playback_pointer() argument
760 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_playback_pointer()
766 return bytes_to_frames(substream->runtime, ptr); snd_sonicvibes_playback_pointer()
769 static snd_pcm_uframes_t snd_sonicvibes_capture_pointer(struct snd_pcm_substream *substream) snd_sonicvibes_capture_pointer() argument
771 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_capture_pointer()
776 return bytes_to_frames(substream->runtime, ptr); snd_sonicvibes_capture_pointer()
817 static int snd_sonicvibes_playback_open(struct snd_pcm_substream *substream) snd_sonicvibes_playback_open() argument
819 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_playback_open()
820 struct snd_pcm_runtime *runtime = substream->runtime; snd_sonicvibes_playback_open()
823 sonic->playback_substream = substream; snd_sonicvibes_playback_open()
829 static int snd_sonicvibes_capture_open(struct snd_pcm_substream *substream) snd_sonicvibes_capture_open() argument
831 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_capture_open()
832 struct snd_pcm_runtime *runtime = substream->runtime; snd_sonicvibes_capture_open()
835 sonic->capture_substream = substream; snd_sonicvibes_capture_open()
842 static int snd_sonicvibes_playback_close(struct snd_pcm_substream *substream) snd_sonicvibes_playback_close() argument
844 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_playback_close()
851 static int snd_sonicvibes_capture_close(struct snd_pcm_substream *substream) snd_sonicvibes_capture_close() argument
853 struct sonicvibes *sonic = snd_pcm_substream_chip(substream); snd_sonicvibes_capture_close()
/linux-4.1.27/sound/usb/misc/
H A Dua101.c114 struct snd_pcm_substream *substream; member in struct:ua101::ua101_stream
202 ua->playback.substream->runtime->delay -= playback_urb_complete()
228 runtime = stream->substream->runtime; copy_playback_data()
317 ua->playback.substream->runtime->delay += frames; playback_tasklet()
321 snd_pcm_period_elapsed(ua->playback.substream); playback_tasklet()
332 runtime = stream->substream->runtime; copy_capture_data()
420 snd_pcm_period_elapsed(stream->substream); capture_urb_complete()
617 snd_pcm_stop_xrun(ua->capture.substream); abort_alsa_capture()
623 snd_pcm_stop_xrun(ua->playback.substream); abort_alsa_playback()
626 static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream, set_stream_hw() argument
631 substream->runtime->hw.info = set_stream_hw()
638 substream->runtime->hw.formats = ua->format_bit; set_stream_hw()
639 substream->runtime->hw.rates = snd_pcm_rate_to_rate_bit(ua->rate); set_stream_hw()
640 substream->runtime->hw.rate_min = ua->rate; set_stream_hw()
641 substream->runtime->hw.rate_max = ua->rate; set_stream_hw()
642 substream->runtime->hw.channels_min = channels; set_stream_hw()
643 substream->runtime->hw.channels_max = channels; set_stream_hw()
644 substream->runtime->hw.buffer_bytes_max = 45000 * 1024; set_stream_hw()
645 substream->runtime->hw.period_bytes_min = 1; set_stream_hw()
646 substream->runtime->hw.period_bytes_max = UINT_MAX; set_stream_hw()
647 substream->runtime->hw.periods_min = 2; set_stream_hw()
648 substream->runtime->hw.periods_max = UINT_MAX; set_stream_hw()
649 err = snd_pcm_hw_constraint_minmax(substream->runtime, set_stream_hw()
655 err = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24); set_stream_hw()
659 static int capture_pcm_open(struct snd_pcm_substream *substream) capture_pcm_open() argument
661 struct ua101 *ua = substream->private_data; capture_pcm_open()
664 ua->capture.substream = substream; capture_pcm_open()
665 err = set_stream_hw(ua, substream, ua->capture.channels); capture_pcm_open()
668 substream->runtime->hw.fifo_size = capture_pcm_open()
670 substream->runtime->delay = substream->runtime->hw.fifo_size; capture_pcm_open()
680 static int playback_pcm_open(struct snd_pcm_substream *substream) playback_pcm_open() argument
682 struct ua101 *ua = substream->private_data; playback_pcm_open()
685 ua->playback.substream = substream; playback_pcm_open()
686 err = set_stream_hw(ua, substream, ua->playback.channels); playback_pcm_open()
689 substream->runtime->hw.fifo_size = playback_pcm_open()
709 static int capture_pcm_close(struct snd_pcm_substream *substream) capture_pcm_close() argument
711 struct ua101 *ua = substream->private_data; capture_pcm_close()
721 static int playback_pcm_close(struct snd_pcm_substream *substream) playback_pcm_close() argument
723 struct ua101 *ua = substream->private_data; playback_pcm_close()
734 static int capture_pcm_hw_params(struct snd_pcm_substream *substream, capture_pcm_hw_params() argument
737 struct ua101 *ua = substream->private_data; capture_pcm_hw_params()
746 return snd_pcm_lib_alloc_vmalloc_buffer(substream, capture_pcm_hw_params()
750 static int playback_pcm_hw_params(struct snd_pcm_substream *substream, playback_pcm_hw_params() argument
753 struct ua101 *ua = substream->private_data; playback_pcm_hw_params()
764 return snd_pcm_lib_alloc_vmalloc_buffer(substream, playback_pcm_hw_params()
768 static int ua101_pcm_hw_free(struct snd_pcm_substream *substream) ua101_pcm_hw_free() argument
770 return snd_pcm_lib_free_vmalloc_buffer(substream); ua101_pcm_hw_free()
773 static int capture_pcm_prepare(struct snd_pcm_substream *substream) capture_pcm_prepare() argument
775 struct ua101 *ua = substream->private_data; capture_pcm_prepare()
803 static int playback_pcm_prepare(struct snd_pcm_substream *substream) playback_pcm_prepare() argument
805 struct ua101 *ua = substream->private_data; playback_pcm_prepare()
825 substream->runtime->delay = 0; playback_pcm_prepare()
831 static int capture_pcm_trigger(struct snd_pcm_substream *substream, int cmd) capture_pcm_trigger() argument
833 struct ua101 *ua = substream->private_data; capture_pcm_trigger()
849 static int playback_pcm_trigger(struct snd_pcm_substream *substream, int cmd) playback_pcm_trigger() argument
851 struct ua101 *ua = substream->private_data; playback_pcm_trigger()
/linux-4.1.27/drivers/media/pci/cx23885/
H A Dcx23885-alsa.c264 snd_pcm_period_elapsed(chip->substream); cx23885_audio_irq()
323 static int snd_cx23885_pcm_open(struct snd_pcm_substream *substream) snd_cx23885_pcm_open() argument
325 struct cx23885_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx23885_pcm_open()
326 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx23885_pcm_open()
340 chip->substream = substream; snd_cx23885_pcm_open()
362 static int snd_cx23885_close(struct snd_pcm_substream *substream) snd_cx23885_close() argument
371 static int snd_cx23885_hw_params(struct snd_pcm_substream *substream, snd_cx23885_hw_params() argument
374 struct cx23885_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx23885_hw_params()
378 if (substream->runtime->dma_area) { snd_cx23885_hw_params()
380 substream->runtime->dma_area = NULL; snd_cx23885_hw_params()
416 substream->runtime->dma_area = chip->buf->vaddr; snd_cx23885_hw_params()
417 substream->runtime->dma_bytes = chip->dma_size; snd_cx23885_hw_params()
418 substream->runtime->dma_addr = 0; snd_cx23885_hw_params()
431 static int snd_cx23885_hw_free(struct snd_pcm_substream *substream) snd_cx23885_hw_free() argument
434 struct cx23885_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx23885_hw_free()
436 if (substream->runtime->dma_area) { snd_cx23885_hw_free()
438 substream->runtime->dma_area = NULL; snd_cx23885_hw_free()
447 static int snd_cx23885_prepare(struct snd_pcm_substream *substream) snd_cx23885_prepare() argument
455 static int snd_cx23885_card_trigger(struct snd_pcm_substream *substream, snd_cx23885_card_trigger() argument
458 struct cx23885_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx23885_card_trigger()
485 struct snd_pcm_substream *substream) snd_cx23885_pointer()
487 struct cx23885_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx23885_pointer()
488 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx23885_pointer()
499 static struct page *snd_cx23885_page(struct snd_pcm_substream *substream, snd_cx23885_page() argument
502 void *pageptr = substream->runtime->dma_area + offset; snd_cx23885_page()
484 snd_cx23885_pointer( struct snd_pcm_substream *substream) snd_cx23885_pointer() argument
/linux-4.1.27/sound/isa/ad1816a/
H A Dad1816a_lib.c206 static int snd_ad1816a_playback_trigger(struct snd_pcm_substream *substream, int cmd) snd_ad1816a_playback_trigger() argument
208 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_playback_trigger()
213 static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd) snd_ad1816a_capture_trigger() argument
215 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_capture_trigger()
220 static int snd_ad1816a_hw_params(struct snd_pcm_substream *substream, snd_ad1816a_hw_params() argument
223 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ad1816a_hw_params()
226 static int snd_ad1816a_hw_free(struct snd_pcm_substream *substream) snd_ad1816a_hw_free() argument
228 return snd_pcm_lib_free_pages(substream); snd_ad1816a_hw_free()
231 static int snd_ad1816a_playback_prepare(struct snd_pcm_substream *substream) snd_ad1816a_playback_prepare() argument
233 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_playback_prepare()
235 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_playback_prepare()
240 chip->p_dma_size = size = snd_pcm_lib_buffer_bytes(substream); snd_ad1816a_playback_prepare()
257 snd_pcm_lib_period_bytes(substream) / 4 - 1); snd_ad1816a_playback_prepare()
263 static int snd_ad1816a_capture_prepare(struct snd_pcm_substream *substream) snd_ad1816a_capture_prepare() argument
265 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_capture_prepare()
267 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_capture_prepare()
272 chip->c_dma_size = size = snd_pcm_lib_buffer_bytes(substream); snd_ad1816a_capture_prepare()
289 snd_pcm_lib_period_bytes(substream) / 4 - 1); snd_ad1816a_capture_prepare()
296 static snd_pcm_uframes_t snd_ad1816a_playback_pointer(struct snd_pcm_substream *substream) snd_ad1816a_playback_pointer() argument
298 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_playback_pointer()
303 return bytes_to_frames(substream->runtime, ptr); snd_ad1816a_playback_pointer()
306 static snd_pcm_uframes_t snd_ad1816a_capture_pointer(struct snd_pcm_substream *substream) snd_ad1816a_capture_pointer() argument
308 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_capture_pointer()
313 return bytes_to_frames(substream->runtime, ptr); snd_ad1816a_capture_pointer()
445 static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream) snd_ad1816a_playback_open() argument
447 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_playback_open()
448 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_playback_open()
456 chip->playback_substream = substream; snd_ad1816a_playback_open()
460 static int snd_ad1816a_capture_open(struct snd_pcm_substream *substream) snd_ad1816a_capture_open() argument
462 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_capture_open()
463 struct snd_pcm_runtime *runtime = substream->runtime; snd_ad1816a_capture_open()
471 chip->capture_substream = substream; snd_ad1816a_capture_open()
475 static int snd_ad1816a_playback_close(struct snd_pcm_substream *substream) snd_ad1816a_playback_close() argument
477 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_playback_close()
484 static int snd_ad1816a_capture_close(struct snd_pcm_substream *substream) snd_ad1816a_capture_close() argument
486 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); snd_ad1816a_capture_close()
/linux-4.1.27/sound/pci/echoaudio/
H A Dmidi.c155 static int snd_echo_midi_input_open(struct snd_rawmidi_substream *substream) snd_echo_midi_input_open() argument
157 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_input_open()
159 chip->midi_in = substream; snd_echo_midi_input_open()
165 static void snd_echo_midi_input_trigger(struct snd_rawmidi_substream *substream, snd_echo_midi_input_trigger() argument
168 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_input_trigger()
180 static int snd_echo_midi_input_close(struct snd_rawmidi_substream *substream) snd_echo_midi_input_close() argument
182 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_input_close()
190 static int snd_echo_midi_output_open(struct snd_rawmidi_substream *substream) snd_echo_midi_output_open() argument
192 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_output_open()
196 chip->midi_out = substream; snd_echo_midi_output_open()
251 static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream, snd_echo_midi_output_trigger() argument
254 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_output_trigger()
281 static int snd_echo_midi_output_close(struct snd_rawmidi_substream *substream) snd_echo_midi_output_close() argument
283 struct echoaudio *chip = substream->rmidi->private_data; snd_echo_midi_output_close()
H A Dechoaudio.c270 static int pcm_open(struct snd_pcm_substream *substream, pcm_open() argument
281 chip = snd_pcm_substream_chip(substream); pcm_open()
282 runtime = substream->runtime; pcm_open()
306 snd_pcm_set_sync(substream); pcm_open()
331 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_open()
350 static int pcm_analog_in_open(struct snd_pcm_substream *substream) pcm_analog_in_open() argument
352 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_analog_in_open()
355 if ((err = pcm_open(substream, num_analog_busses_in(chip) - pcm_analog_in_open()
356 substream->number)) < 0) pcm_analog_in_open()
358 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_in_open()
363 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_in_open()
379 static int pcm_analog_out_open(struct snd_pcm_substream *substream) pcm_analog_out_open() argument
381 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_analog_out_open()
389 if ((err = pcm_open(substream, max_channels - substream->number)) < 0) pcm_analog_out_open()
391 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_out_open()
397 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_analog_out_open()
416 static int pcm_digital_in_open(struct snd_pcm_substream *substream) pcm_digital_in_open() argument
418 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_digital_in_open()
421 max_channels = num_digital_busses_in(chip) - substream->number; pcm_digital_in_open()
424 err = pcm_open(substream, max_channels); pcm_digital_in_open()
428 err = pcm_open(substream, max_channels - ECHOCARD_HAS_ADAT); pcm_digital_in_open()
433 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_in_open()
438 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_in_open()
457 static int pcm_digital_out_open(struct snd_pcm_substream *substream) pcm_digital_out_open() argument
459 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_digital_out_open()
462 max_channels = num_digital_busses_out(chip) - substream->number; pcm_digital_out_open()
465 err = pcm_open(substream, max_channels); pcm_digital_out_open()
469 err = pcm_open(substream, max_channels - ECHOCARD_HAS_ADAT); pcm_digital_out_open()
474 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_out_open()
480 if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, pcm_digital_out_open()
500 static int pcm_close(struct snd_pcm_substream *substream) pcm_close() argument
502 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_close()
526 static int init_engine(struct snd_pcm_substream *substream, init_engine() argument
534 chip = snd_pcm_substream_chip(substream); init_engine()
535 pipe = (struct audiopipe *) substream->runtime->private_data; init_engine()
545 chip->substream[pipe->index] = NULL; init_engine()
562 err = snd_pcm_lib_malloc_pages(substream, init_engine()
582 addr = snd_pcm_sgbuf_get_addr(substream, offs); init_engine()
605 * initialized before chip->substream init_engine()
611 chip->substream[pipe_index] = substream; init_engine()
621 static int pcm_analog_in_hw_params(struct snd_pcm_substream *substream, pcm_analog_in_hw_params() argument
624 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_analog_in_hw_params()
626 return init_engine(substream, hw_params, px_analog_in(chip) + pcm_analog_in_hw_params()
627 substream->number, params_channels(hw_params)); pcm_analog_in_hw_params()
632 static int pcm_analog_out_hw_params(struct snd_pcm_substream *substream, pcm_analog_out_hw_params() argument
635 return init_engine(substream, hw_params, substream->number, pcm_analog_out_hw_params()
643 static int pcm_digital_in_hw_params(struct snd_pcm_substream *substream, pcm_digital_in_hw_params() argument
646 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_digital_in_hw_params()
648 return init_engine(substream, hw_params, px_digital_in(chip) + pcm_digital_in_hw_params()
649 substream->number, params_channels(hw_params)); pcm_digital_in_hw_params()
655 static int pcm_digital_out_hw_params(struct snd_pcm_substream *substream, pcm_digital_out_hw_params() argument
658 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_digital_out_hw_params()
660 return init_engine(substream, hw_params, px_digital_out(chip) + pcm_digital_out_hw_params()
661 substream->number, params_channels(hw_params)); pcm_digital_out_hw_params()
669 static int pcm_hw_free(struct snd_pcm_substream *substream) pcm_hw_free() argument
674 chip = snd_pcm_substream_chip(substream); pcm_hw_free()
675 pipe = (struct audiopipe *) substream->runtime->private_data; pcm_hw_free()
681 chip->substream[pipe->index] = NULL; pcm_hw_free()
686 snd_pcm_lib_free_pages(substream); pcm_hw_free()
692 static int pcm_prepare(struct snd_pcm_substream *substream) pcm_prepare() argument
694 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_prepare()
695 struct snd_pcm_runtime *runtime = substream->runtime; pcm_prepare()
736 static int pcm_trigger(struct snd_pcm_substream *substream, int cmd) pcm_trigger() argument
738 struct echoaudio *chip = snd_pcm_substream_chip(substream); pcm_trigger()
739 struct snd_pcm_runtime *runtime = substream->runtime; pcm_trigger()
745 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
747 if (s == chip->substream[i]) { snd_pcm_group_for_each_entry()
749 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
761 pipe = chip->substream[i]->runtime->private_data;
783 pipe = chip->substream[i]->runtime->private_data;
792 pipe = chip->substream[i]->runtime->private_data;
807 static snd_pcm_uframes_t pcm_pointer(struct snd_pcm_substream *substream) pcm_pointer() argument
809 struct snd_pcm_runtime *runtime = substream->runtime; pcm_pointer()
816 bufsize = substream->runtime->buffer_size; pcm_pointer()
817 pos = bytes_to_frames(substream->runtime, pipe->position); pcm_pointer()
820 pipe->position -= frames_to_bytes(substream->runtime, bufsize); pcm_pointer()
880 /* Preallocate memory only for the first substream because it's the most
889 for (ss = pcm->streams[stream].substream; ss; ss = ss->next) { snd_echo_preallocate_pages()
1825 struct snd_pcm_substream *substream; snd_echo_interrupt() local
1834 /* The hardware doesn't tell us which substream caused the irq, snd_echo_interrupt()
1837 substream = chip->substream[ss]; snd_echo_interrupt()
1838 if (substream && ((struct audiopipe *)substream->runtime-> snd_echo_interrupt()
1840 period = pcm_pointer(substream) / snd_echo_interrupt()
1841 substream->runtime->period_size; snd_echo_interrupt()
1845 snd_pcm_period_elapsed(substream); snd_echo_interrupt()
/linux-4.1.27/sound/pci/ymfpci/
H A Dymfpci_main.c311 if (ypcm->substream == NULL) snd_ymfpci_pcm_interrupt()
331 snd_pcm_period_elapsed(ypcm->substream); snd_ymfpci_pcm_interrupt()
336 unsigned int subs = ypcm->substream->number; snd_ymfpci_pcm_interrupt()
358 static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream) snd_ymfpci_pcm_capture_interrupt() argument
360 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_pcm_capture_interrupt()
383 snd_pcm_period_elapsed(substream); snd_ymfpci_pcm_capture_interrupt()
390 static int snd_ymfpci_playback_trigger(struct snd_pcm_substream *substream, snd_ymfpci_playback_trigger() argument
393 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_trigger()
394 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_playback_trigger()
413 if (substream->pcm == chip->pcm && !ypcm->use_441_slot) { snd_ymfpci_playback_trigger()
414 kctl = chip->pcm_mixer[substream->number].ctl; snd_ymfpci_playback_trigger()
435 static int snd_ymfpci_capture_trigger(struct snd_pcm_substream *substream, snd_ymfpci_capture_trigger() argument
438 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_trigger()
439 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_capture_trigger()
523 [ypcm->substream->number].left << 15); snd_ymfpci_pcm_init_voice()
525 [ypcm->substream->number].right << 15); snd_ymfpci_pcm_init_voice()
638 static int snd_ymfpci_playback_hw_params(struct snd_pcm_substream *substream, snd_ymfpci_playback_hw_params() argument
641 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_hw_params()
645 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_ymfpci_playback_hw_params()
652 static int snd_ymfpci_playback_hw_free(struct snd_pcm_substream *substream) snd_ymfpci_playback_hw_free() argument
654 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_hw_free()
655 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_hw_free()
664 snd_pcm_lib_free_pages(substream); snd_ymfpci_playback_hw_free()
676 static int snd_ymfpci_playback_prepare(struct snd_pcm_substream *substream) snd_ymfpci_playback_prepare() argument
678 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_prepare()
679 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_prepare()
690 substream->pcm == chip->pcm); snd_ymfpci_playback_prepare()
692 if (substream->pcm == chip->pcm && !ypcm->use_441_slot) { snd_ymfpci_playback_prepare()
693 kctl = chip->pcm_mixer[substream->number].ctl; snd_ymfpci_playback_prepare()
700 static int snd_ymfpci_capture_hw_params(struct snd_pcm_substream *substream, snd_ymfpci_capture_hw_params() argument
703 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_ymfpci_capture_hw_params()
706 static int snd_ymfpci_capture_hw_free(struct snd_pcm_substream *substream) snd_ymfpci_capture_hw_free() argument
708 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_hw_free()
712 return snd_pcm_lib_free_pages(substream); snd_ymfpci_capture_hw_free()
715 static int snd_ymfpci_capture_prepare(struct snd_pcm_substream *substream) snd_ymfpci_capture_prepare() argument
717 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_prepare()
718 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_prepare()
759 static snd_pcm_uframes_t snd_ymfpci_playback_pointer(struct snd_pcm_substream *substream) snd_ymfpci_playback_pointer() argument
761 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_pointer()
762 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_pointer()
771 static snd_pcm_uframes_t snd_ymfpci_capture_pointer(struct snd_pcm_substream *substream) snd_ymfpci_capture_pointer() argument
773 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_pointer()
774 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_pointer()
897 static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream) snd_ymfpci_playback_open_1() argument
899 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_open_1()
900 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_open_1()
920 ypcm->substream = substream; snd_ymfpci_playback_open_1()
951 static int snd_ymfpci_playback_open(struct snd_pcm_substream *substream) snd_ymfpci_playback_open() argument
953 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_open()
954 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_open()
958 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) snd_ymfpci_playback_open()
973 static int snd_ymfpci_playback_spdif_open(struct snd_pcm_substream *substream) snd_ymfpci_playback_spdif_open() argument
975 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_spdif_open()
976 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_spdif_open()
980 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) snd_ymfpci_playback_spdif_open()
1001 static int snd_ymfpci_playback_4ch_open(struct snd_pcm_substream *substream) snd_ymfpci_playback_4ch_open() argument
1003 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_4ch_open()
1004 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_playback_4ch_open()
1008 if ((err = snd_ymfpci_playback_open_1(substream)) < 0) snd_ymfpci_playback_4ch_open()
1021 static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream, snd_ymfpci_capture_open() argument
1024 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_open()
1025 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_open()
1045 ypcm->substream = substream; snd_ymfpci_capture_open()
1047 chip->capture_substream[capture_bank_number] = substream; snd_ymfpci_capture_open()
1054 static int snd_ymfpci_capture_rec_open(struct snd_pcm_substream *substream) snd_ymfpci_capture_rec_open() argument
1056 return snd_ymfpci_capture_open(substream, 0); snd_ymfpci_capture_rec_open()
1059 static int snd_ymfpci_capture_ac97_open(struct snd_pcm_substream *substream) snd_ymfpci_capture_ac97_open() argument
1061 return snd_ymfpci_capture_open(substream, 1); snd_ymfpci_capture_ac97_open()
1064 static int snd_ymfpci_playback_close_1(struct snd_pcm_substream *substream) snd_ymfpci_playback_close_1() argument
1069 static int snd_ymfpci_playback_close(struct snd_pcm_substream *substream) snd_ymfpci_playback_close() argument
1071 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_close()
1072 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_playback_close()
1080 return snd_ymfpci_playback_close_1(substream); snd_ymfpci_playback_close()
1083 static int snd_ymfpci_playback_spdif_close(struct snd_pcm_substream *substream) snd_ymfpci_playback_spdif_close() argument
1085 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_spdif_close()
1097 return snd_ymfpci_playback_close_1(substream); snd_ymfpci_playback_spdif_close()
1100 static int snd_ymfpci_playback_4ch_close(struct snd_pcm_substream *substream) snd_ymfpci_playback_4ch_close() argument
1102 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_playback_4ch_close()
1110 return snd_ymfpci_playback_close_1(substream); snd_ymfpci_playback_4ch_close()
1113 static int snd_ymfpci_capture_close(struct snd_pcm_substream *substream) snd_ymfpci_capture_close() argument
1115 struct snd_ymfpci *chip = snd_pcm_substream_chip(substream); snd_ymfpci_capture_close()
1116 struct snd_pcm_runtime *runtime = substream->runtime; snd_ymfpci_capture_close()
1754 struct snd_pcm_substream *substream; snd_ymfpci_pcm_vol_put() local
1766 substream = (struct snd_pcm_substream *)kcontrol->private_value; snd_ymfpci_pcm_vol_put()
1768 if (substream->runtime && substream->runtime->private_data) { snd_ymfpci_pcm_vol_put()
1769 struct snd_ymfpci_pcm *ypcm = substream->runtime->private_data; snd_ymfpci_pcm_vol_put()
1810 struct snd_pcm_substream *substream; snd_ymfpci_mixer() local
1872 substream = chip->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; snd_ymfpci_mixer()
1879 kctl->private_value = (unsigned long)substream; snd_ymfpci_mixer()
1885 substream = substream->next; snd_ymfpci_mixer()
/linux-4.1.27/sound/isa/msnd/
H A Dmsnd.c478 static int snd_msnd_playback_open(struct snd_pcm_substream *substream) snd_msnd_playback_open() argument
480 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_playback_open()
481 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_open()
490 chip->playback_substream = substream; snd_msnd_playback_open()
495 static int snd_msnd_playback_close(struct snd_pcm_substream *substream) snd_msnd_playback_close() argument
497 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_close()
505 static int snd_msnd_playback_hw_params(struct snd_pcm_substream *substream, snd_msnd_playback_hw_params() argument
509 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_hw_params()
528 static int snd_msnd_playback_prepare(struct snd_pcm_substream *substream) snd_msnd_playback_prepare() argument
530 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_prepare()
531 unsigned int pcm_size = snd_pcm_lib_buffer_bytes(substream); snd_msnd_playback_prepare()
532 unsigned int pcm_count = snd_pcm_lib_period_bytes(substream); snd_msnd_playback_prepare()
540 static int snd_msnd_playback_trigger(struct snd_pcm_substream *substream, snd_msnd_playback_trigger() argument
543 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_trigger()
566 snd_msnd_playback_pointer(struct snd_pcm_substream *substream) snd_msnd_playback_pointer() argument
568 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_playback_pointer()
570 return bytes_to_frames(substream->runtime, chip->playDMAPos); snd_msnd_playback_pointer()
584 static int snd_msnd_capture_open(struct snd_pcm_substream *substream) snd_msnd_capture_open() argument
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_capture_open()
587 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_open()
594 chip->capture_substream = substream; snd_msnd_capture_open()
599 static int snd_msnd_capture_close(struct snd_pcm_substream *substream) snd_msnd_capture_close() argument
601 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_close()
608 static int snd_msnd_capture_prepare(struct snd_pcm_substream *substream) snd_msnd_capture_prepare() argument
610 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_prepare()
611 unsigned int pcm_size = snd_pcm_lib_buffer_bytes(substream); snd_msnd_capture_prepare()
612 unsigned int pcm_count = snd_pcm_lib_period_bytes(substream); snd_msnd_capture_prepare()
620 static int snd_msnd_capture_trigger(struct snd_pcm_substream *substream, snd_msnd_capture_trigger() argument
623 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_trigger()
642 snd_msnd_capture_pointer(struct snd_pcm_substream *substream) snd_msnd_capture_pointer() argument
644 struct snd_pcm_runtime *runtime = substream->runtime; snd_msnd_capture_pointer()
645 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_pointer()
651 static int snd_msnd_capture_hw_params(struct snd_pcm_substream *substream, snd_msnd_capture_hw_params() argument
655 struct snd_msnd *chip = snd_pcm_substream_chip(substream); snd_msnd_capture_hw_params()
H A Dmsnd_midi.c56 static int snd_msndmidi_input_open(struct snd_rawmidi_substream *substream) snd_msndmidi_input_open() argument
62 mpu = substream->rmidi->private_data; snd_msndmidi_input_open()
64 mpu->substream_input = substream; snd_msndmidi_input_open()
73 static int snd_msndmidi_input_close(struct snd_rawmidi_substream *substream) snd_msndmidi_input_close() argument
77 mpu = substream->rmidi->private_data; snd_msndmidi_input_close()
96 static void snd_msndmidi_input_trigger(struct snd_rawmidi_substream *substream, snd_msndmidi_input_trigger() argument
104 mpu = substream->rmidi->private_data; snd_msndmidi_input_trigger()
/linux-4.1.27/sound/pci/lx6464es/
H A Dlx6464es.c106 struct snd_pcm_substream *substream) lx_hardware_open()
109 struct snd_pcm_runtime *runtime = substream->runtime; lx_hardware_open()
111 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_hardware_open()
133 struct snd_pcm_substream *substream) lx_hardware_start()
136 struct snd_pcm_runtime *runtime = substream->runtime; lx_hardware_start()
137 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_hardware_start()
165 struct snd_pcm_substream *substream) lx_hardware_stop()
168 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_hardware_stop()
196 struct snd_pcm_substream *substream) lx_hardware_close()
199 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_hardware_close()
212 static int lx_pcm_open(struct snd_pcm_substream *substream) lx_pcm_open() argument
214 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_open()
215 struct snd_pcm_runtime *runtime = substream->runtime; lx_pcm_open()
259 snd_pcm_set_sync(substream); lx_pcm_open()
270 static int lx_pcm_close(struct snd_pcm_substream *substream) lx_pcm_close() argument
273 dev_dbg(substream->pcm->card->dev, "->lx_pcm_close\n"); lx_pcm_close()
278 *substream) lx_pcm_stream_pointer()
280 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_stream_pointer()
282 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_pcm_stream_pointer()
290 pos = lx_stream->frame_pos * substream->runtime->period_size; lx_pcm_stream_pointer()
297 static int lx_pcm_prepare(struct snd_pcm_substream *substream) lx_pcm_prepare() argument
299 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_prepare()
301 const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_pcm_prepare()
308 err = lx_hardware_stop(chip, substream); lx_pcm_prepare()
315 err = lx_hardware_close(chip, substream); lx_pcm_prepare()
324 err = lx_hardware_open(chip, substream); lx_pcm_prepare()
331 err = lx_hardware_start(chip, substream); lx_pcm_prepare()
340 if (chip->board_sample_rate != substream->runtime->rate) { lx_pcm_prepare()
342 chip->board_sample_rate = substream->runtime->rate; lx_pcm_prepare()
350 static int lx_pcm_hw_params(struct snd_pcm_substream *substream, lx_pcm_hw_params() argument
353 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_hw_params()
361 err = snd_pcm_lib_malloc_pages(substream, lx_pcm_hw_params()
365 chip->capture_stream.stream = substream; lx_pcm_hw_params()
367 chip->playback_stream.stream = substream; lx_pcm_hw_params()
373 static int lx_pcm_hw_params_playback(struct snd_pcm_substream *substream, lx_pcm_hw_params_playback() argument
376 return lx_pcm_hw_params(substream, hw_params, 0); lx_pcm_hw_params_playback()
379 static int lx_pcm_hw_params_capture(struct snd_pcm_substream *substream, lx_pcm_hw_params_capture() argument
382 return lx_pcm_hw_params(substream, hw_params, 1); lx_pcm_hw_params_capture()
385 static int lx_pcm_hw_free(struct snd_pcm_substream *substream) lx_pcm_hw_free() argument
387 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_hw_free()
389 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_pcm_hw_free()
395 err = lx_hardware_stop(chip, substream); lx_pcm_hw_free()
402 err = lx_hardware_close(chip, substream); lx_pcm_hw_free()
412 err = snd_pcm_lib_free_pages(substream); lx_pcm_hw_free()
426 struct snd_pcm_substream *substream = lx_stream->stream; lx_trigger_start() local
431 const u32 channels = substream->runtime->channels; lx_trigger_start()
433 const u32 period_size = substream->runtime->period_size; lx_trigger_start()
434 const u32 periods = substream->runtime->periods; lx_trigger_start()
437 dma_addr_t buf = substream->dma_buffer.addr; lx_trigger_start()
533 static int lx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) lx_pcm_trigger() argument
535 struct lx6464es *chip = snd_pcm_substream_chip(substream); lx_pcm_trigger()
536 const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); lx_pcm_trigger()
105 lx_hardware_open(struct lx6464es *chip, struct snd_pcm_substream *substream) lx_hardware_open() argument
132 lx_hardware_start(struct lx6464es *chip, struct snd_pcm_substream *substream) lx_hardware_start() argument
164 lx_hardware_stop(struct lx6464es *chip, struct snd_pcm_substream *substream) lx_hardware_stop() argument
195 lx_hardware_close(struct lx6464es *chip, struct snd_pcm_substream *substream) lx_hardware_close() argument
277 lx_pcm_stream_pointer(struct snd_pcm_substream *substream) lx_pcm_stream_pointer() argument
/linux-4.1.27/sound/pci/cs46xx/
H A Dcs46xx_lib.c878 static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream, snd_cs46xx_pb_trans_copy() argument
881 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_pb_trans_copy()
886 static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream) snd_cs46xx_playback_transfer() argument
888 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_transfer()
890 snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy); snd_cs46xx_playback_transfer()
894 static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream, snd_cs46xx_cp_trans_copy() argument
897 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_cp_trans_copy()
898 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_cp_trans_copy()
903 static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream) snd_cs46xx_capture_transfer() argument
905 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_transfer()
906 snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy); snd_cs46xx_capture_transfer()
910 static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream) snd_cs46xx_playback_direct_pointer() argument
912 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_direct_pointer()
914 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_direct_pointer()
928 static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream) snd_cs46xx_playback_indirect_pointer() argument
930 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_indirect_pointer()
932 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_indirect_pointer()
942 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); snd_cs46xx_playback_indirect_pointer()
945 static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream) snd_cs46xx_capture_direct_pointer() argument
947 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_direct_pointer()
952 static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream) snd_cs46xx_capture_indirect_pointer() argument
954 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_indirect_pointer()
956 return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr); snd_cs46xx_capture_indirect_pointer()
959 static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream, snd_cs46xx_playback_trigger() argument
962 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_trigger()
963 /*struct snd_pcm_runtime *runtime = substream->runtime;*/ snd_cs46xx_playback_trigger()
967 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; snd_cs46xx_playback_trigger()
983 if (substream->runtime->periods != CS46XX_FRAGS) snd_cs46xx_playback_trigger()
984 snd_cs46xx_playback_transfer(substream); snd_cs46xx_playback_trigger()
987 if (substream->runtime->periods != CS46XX_FRAGS) snd_cs46xx_playback_trigger()
988 snd_cs46xx_playback_transfer(substream); snd_cs46xx_playback_trigger()
1024 static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream, snd_cs46xx_capture_trigger() argument
1027 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_trigger()
1092 static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, snd_cs46xx_playback_hw_params() argument
1095 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_hw_params()
1099 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_hw_params()
1136 snd_pcm_lib_free_pages(substream); snd_cs46xx_playback_hw_params()
1144 substream->ops = &snd_cs46xx_playback_ops; snd_cs46xx_playback_hw_params()
1146 substream->ops = &snd_cs46xx_playback_rear_ops; snd_cs46xx_playback_hw_params()
1148 substream->ops = &snd_cs46xx_playback_clfe_ops; snd_cs46xx_playback_hw_params()
1150 substream->ops = &snd_cs46xx_playback_iec958_ops; snd_cs46xx_playback_hw_params()
1155 substream->ops = &snd_cs46xx_playback_ops; snd_cs46xx_playback_hw_params()
1164 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) { snd_cs46xx_playback_hw_params()
1173 substream->ops = &snd_cs46xx_playback_indirect_ops; snd_cs46xx_playback_hw_params()
1175 substream->ops = &snd_cs46xx_playback_indirect_rear_ops; snd_cs46xx_playback_hw_params()
1177 substream->ops = &snd_cs46xx_playback_indirect_clfe_ops; snd_cs46xx_playback_hw_params()
1179 substream->ops = &snd_cs46xx_playback_indirect_iec958_ops; snd_cs46xx_playback_hw_params()
1184 substream->ops = &snd_cs46xx_playback_indirect_ops; snd_cs46xx_playback_hw_params()
1196 static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream) snd_cs46xx_playback_hw_free() argument
1198 /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/ snd_cs46xx_playback_hw_free()
1199 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_hw_free()
1209 snd_pcm_lib_free_pages(substream); snd_cs46xx_playback_hw_free()
1218 static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream) snd_cs46xx_playback_prepare() argument
1222 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_prepare()
1223 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_prepare()
1263 cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_cs46xx_playback_prepare()
1289 static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream, snd_cs46xx_capture_hw_params() argument
1292 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_hw_params()
1293 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_hw_params()
1301 snd_pcm_lib_free_pages(substream); snd_cs46xx_capture_hw_params()
1305 substream->ops = &snd_cs46xx_capture_ops; snd_cs46xx_capture_hw_params()
1312 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_cs46xx_capture_hw_params()
1314 substream->ops = &snd_cs46xx_capture_indirect_ops; snd_cs46xx_capture_hw_params()
1320 static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream) snd_cs46xx_capture_hw_free() argument
1322 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_hw_free()
1323 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_hw_free()
1326 snd_pcm_lib_free_pages(substream); snd_cs46xx_capture_hw_free()
1334 static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream) snd_cs46xx_capture_prepare() argument
1336 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_prepare()
1337 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_capture_prepare()
1342 chip->capt.pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); snd_cs46xx_capture_prepare()
1376 if (chip->capt.substream) snd_cs46xx_interrupt()
1377 snd_pcm_period_elapsed(chip->capt.substream); snd_cs46xx_interrupt()
1383 snd_pcm_period_elapsed(cpcm->substream); snd_cs46xx_interrupt()
1393 snd_pcm_period_elapsed(cpcm->substream); snd_cs46xx_interrupt()
1402 if (chip->playback_pcm->substream) snd_cs46xx_interrupt()
1403 snd_pcm_period_elapsed(chip->playback_pcm->substream); snd_cs46xx_interrupt()
1406 if (chip->capt.substream) snd_cs46xx_interrupt()
1407 snd_pcm_period_elapsed(chip->capt.substream); snd_cs46xx_interrupt()
1500 static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id) _cs46xx_playback_open_channel() argument
1502 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); _cs46xx_playback_open_channel()
1504 struct snd_pcm_runtime *runtime = substream->runtime; _cs46xx_playback_open_channel()
1519 cpcm->substream = substream; _cs46xx_playback_open_channel()
1536 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; _cs46xx_playback_open_channel()
1542 static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream) snd_cs46xx_playback_open() argument
1544 dev_dbg(substream->pcm->card->dev, "open front channel\n"); snd_cs46xx_playback_open()
1545 return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); snd_cs46xx_playback_open()
1549 static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream) snd_cs46xx_playback_open_rear() argument
1551 dev_dbg(substream->pcm->card->dev, "open rear channel\n"); snd_cs46xx_playback_open_rear()
1552 return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); snd_cs46xx_playback_open_rear()
1555 static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream) snd_cs46xx_playback_open_clfe() argument
1557 dev_dbg(substream->pcm->card->dev, "open center - LFE channel\n"); snd_cs46xx_playback_open_clfe()
1558 return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); snd_cs46xx_playback_open_clfe()
1561 static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream) snd_cs46xx_playback_open_iec958() argument
1563 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_open_iec958()
1571 return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL); snd_cs46xx_playback_open_iec958()
1574 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream);
1576 static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream) snd_cs46xx_playback_close_iec958() argument
1579 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_close_iec958()
1583 err = snd_cs46xx_playback_close(substream); snd_cs46xx_playback_close_iec958()
1593 static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream) snd_cs46xx_capture_open() argument
1595 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_open()
1600 chip->capt.substream = substream; snd_cs46xx_capture_open()
1601 substream->runtime->hw = snd_cs46xx_capture; snd_cs46xx_capture_open()
1604 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; snd_cs46xx_capture_open()
1609 snd_pcm_hw_constraint_list(substream->runtime, 0, snd_cs46xx_capture_open()
1616 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream) snd_cs46xx_playback_close() argument
1618 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_playback_close()
1619 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs46xx_playback_close()
1638 cpcm->substream = NULL; snd_cs46xx_playback_close()
1645 static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream) snd_cs46xx_capture_close() argument
1647 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); snd_cs46xx_capture_close()
1649 chip->capt.substream = NULL; snd_cs46xx_capture_close()
2563 static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream) snd_cs46xx_midi_input_open() argument
2565 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_input_open()
2571 chip->midi_input = substream; snd_cs46xx_midi_input_open()
2581 static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream) snd_cs46xx_midi_input_close() argument
2583 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_input_close()
2599 static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream) snd_cs46xx_midi_output_open() argument
2601 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_output_open()
2608 chip->midi_output = substream; snd_cs46xx_midi_output_open()
2618 static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream) snd_cs46xx_midi_output_close() argument
2620 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_output_close()
2636 static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_cs46xx_midi_input_trigger() argument
2639 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_input_trigger()
2656 static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_cs46xx_midi_output_trigger() argument
2659 struct snd_cs46xx *chip = substream->rmidi->private_data; snd_cs46xx_midi_output_trigger()
2669 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) { snd_cs46xx_midi_output_trigger()
/linux-4.1.27/sound/pci/asihpi/
H A Dasihpi.c134 void (*pcm_start)(struct snd_pcm_substream *substream);
135 void (*pcm_stop)(struct snd_pcm_substream *substream);
162 struct snd_pcm_substream *substream; member in struct:snd_card_asihpi_pcm
296 static void print_hwparams(struct snd_pcm_substream *substream, print_hwparams() argument
300 snd_pcm_debug_name(substream, name, sizeof(name)); print_hwparams()
451 static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, snd_card_asihpi_pcm_hw_params() argument
454 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_hw_params()
456 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); snd_card_asihpi_pcm_hw_params()
462 print_hwparams(substream, params); snd_card_asihpi_pcm_hw_params()
463 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); snd_card_asihpi_pcm_hw_params()
474 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { snd_card_asihpi_pcm_hw_params()
516 snd_card_asihpi_hw_free(struct snd_pcm_substream *substream) snd_card_asihpi_hw_free() argument
518 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_hw_free()
523 snd_pcm_lib_free_pages(substream); snd_card_asihpi_hw_free()
534 substream) snd_card_asihpi_pcm_timer_start()
536 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_timer_start()
547 static void snd_card_asihpi_pcm_timer_stop(struct snd_pcm_substream *substream) snd_card_asihpi_pcm_timer_stop() argument
549 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_pcm_timer_stop()
556 static void snd_card_asihpi_pcm_int_start(struct snd_pcm_substream *substream) snd_card_asihpi_pcm_int_start() argument
561 BUG_ON(!substream); snd_card_asihpi_pcm_int_start()
563 dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data; snd_card_asihpi_pcm_int_start()
564 card = snd_pcm_substream_chip(substream); snd_card_asihpi_pcm_int_start()
576 static void snd_card_asihpi_pcm_int_stop(struct snd_pcm_substream *substream) snd_card_asihpi_pcm_int_stop() argument
581 BUG_ON(!substream); snd_card_asihpi_pcm_int_stop()
583 dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data; snd_card_asihpi_pcm_int_stop()
584 card = snd_pcm_substream_chip(substream); snd_card_asihpi_pcm_int_stop()
598 static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, snd_card_asihpi_trigger() argument
601 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; snd_card_asihpi_trigger()
602 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); snd_card_asihpi_trigger()
607 snd_pcm_debug_name(substream, name, sizeof(name)); snd_card_asihpi_trigger()
612 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
620 if (substream->stream != s->stream) snd_pcm_group_for_each_entry()
647 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
656 card->pcm_start(substream);
657 if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) ||
664 card->pcm_stop(substream); snd_pcm_group_for_each_entry()
665 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
669 if (substream->stream != s->stream) snd_pcm_group_for_each_entry()
678 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
685 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
695 card->pcm_start(substream);
700 card->pcm_stop(substream);
759 struct snd_pcm_substream *substream = dpcm->substream; snd_card_asihpi_timer_function() local
760 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); snd_card_asihpi_timer_function()
773 snd_pcm_debug_name(substream, name, sizeof(name)); snd_card_asihpi_timer_function()
776 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
784 if (substream->stream != s->stream) snd_pcm_group_for_each_entry()
868 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
873 if (substream->stream != s->stream) snd_pcm_group_for_each_entry()
968 static int snd_card_asihpi_playback_ioctl(struct snd_pcm_substream *substream, snd_card_asihpi_playback_ioctl() argument
972 snd_pcm_debug_name(substream, name, sizeof(name)); snd_card_asihpi_playback_ioctl()
974 return snd_pcm_lib_ioctl(substream, cmd, arg); snd_card_asihpi_playback_ioctl()
978 substream) snd_card_asihpi_playback_prepare()
980 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_prepare()
983 snd_printdd("P%d prepare\n", substream->number); snd_card_asihpi_playback_prepare()
993 snd_card_asihpi_playback_pointer(struct snd_pcm_substream *substream) snd_card_asihpi_playback_pointer() argument
995 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_pointer()
999 snd_pcm_debug_name(substream, name, sizeof(name)); snd_card_asihpi_playback_pointer()
1039 static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) snd_card_asihpi_playback_open() argument
1041 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_open()
1043 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); snd_card_asihpi_playback_open()
1052 substream->number, &dpcm->h_stream); snd_card_asihpi_playback_open()
1068 dpcm->substream = substream; snd_card_asihpi_playback_open()
1107 snd_pcm_set_sync(substream); snd_card_asihpi_playback_open()
1130 static int snd_card_asihpi_playback_close(struct snd_pcm_substream *substream) snd_card_asihpi_playback_close() argument
1132 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_playback_close()
1154 snd_card_asihpi_capture_pointer(struct snd_pcm_substream *substream) snd_card_asihpi_capture_pointer() argument
1156 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_pointer()
1159 snd_pcm_debug_name(substream, name, sizeof(name)); snd_card_asihpi_capture_pointer()
1169 static int snd_card_asihpi_capture_ioctl(struct snd_pcm_substream *substream, snd_card_asihpi_capture_ioctl() argument
1172 return snd_pcm_lib_ioctl(substream, cmd, arg); snd_card_asihpi_capture_ioctl()
1175 static int snd_card_asihpi_capture_prepare(struct snd_pcm_substream *substream) snd_card_asihpi_capture_prepare() argument
1177 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_prepare()
1185 snd_printdd("Capture Prepare %d\n", substream->number); snd_card_asihpi_capture_prepare()
1222 static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) snd_card_asihpi_capture_open() argument
1224 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_asihpi_capture_open()
1225 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); snd_card_asihpi_capture_open()
1235 card->hpi->adapter->index, substream->number); snd_card_asihpi_capture_open()
1239 substream->number, &dpcm->h_stream)); snd_card_asihpi_capture_open()
1249 dpcm->substream = substream; snd_card_asihpi_capture_open()
1295 snd_pcm_set_sync(substream); snd_card_asihpi_capture_open()
1300 static int snd_card_asihpi_capture_close(struct snd_pcm_substream *substream) snd_card_asihpi_capture_close() argument
1302 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; snd_card_asihpi_capture_close()
533 snd_card_asihpi_pcm_timer_start(struct snd_pcm_substream * substream) snd_card_asihpi_pcm_timer_start() argument
977 snd_card_asihpi_playback_prepare(struct snd_pcm_substream * substream) snd_card_asihpi_playback_prepare() argument
/linux-4.1.27/sound/soc/dwc/
H A Ddesignware_i2s.c142 struct snd_pcm_substream *substream) i2s_start()
147 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) i2s_start()
156 struct snd_pcm_substream *substream) i2s_stop()
160 i2s_clear_irqs(dev, substream->stream); i2s_stop()
161 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { i2s_stop()
183 static int dw_i2s_startup(struct snd_pcm_substream *substream, dw_i2s_startup() argument
190 (substream->stream == SNDRV_PCM_STREAM_CAPTURE)) dw_i2s_startup()
194 (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) dw_i2s_startup()
197 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) dw_i2s_startup()
199 else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) dw_i2s_startup()
202 snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)dma_data); dw_i2s_startup()
207 static int dw_i2s_hw_params(struct snd_pcm_substream *substream, dw_i2s_hw_params() argument
252 i2s_disable_channels(dev, substream->stream); dw_i2s_hw_params()
255 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dw_i2s_hw_params()
296 static void dw_i2s_shutdown(struct snd_pcm_substream *substream, dw_i2s_shutdown() argument
299 snd_soc_dai_set_dma_data(dai, substream, NULL); dw_i2s_shutdown()
302 static int dw_i2s_prepare(struct snd_pcm_substream *substream, dw_i2s_prepare() argument
307 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) dw_i2s_prepare()
315 static int dw_i2s_trigger(struct snd_pcm_substream *substream, dw_i2s_trigger() argument
326 i2s_start(dev, substream); dw_i2s_trigger()
333 i2s_stop(dev, substream); dw_i2s_trigger()
141 i2s_start(struct dw_i2s_dev *dev, struct snd_pcm_substream *substream) i2s_start() argument
155 i2s_stop(struct dw_i2s_dev *dev, struct snd_pcm_substream *substream) i2s_stop() argument
/linux-4.1.27/sound/soc/intel/haswell/
H A Dsst-haswell-pcm.c119 struct snd_pcm_substream *substream; member in struct:hsw_pcm_data
439 static int create_adsp_page_table(struct snd_pcm_substream *substream, create_adsp_page_table() argument
443 struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream); create_adsp_page_table()
444 int i, pages, stream = substream->stream; create_adsp_page_table()
470 static int hsw_pcm_hw_params(struct snd_pcm_substream *substream, hsw_pcm_hw_params() argument
473 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_pcm_hw_params()
474 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_hw_params()
489 pcm_data = &pdata->pcm[dai][substream->stream]; hsw_pcm_hw_params()
515 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) hsw_pcm_hw_params()
523 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { hsw_pcm_hw_params()
604 ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); hsw_pcm_hw_params()
611 dmab = snd_pcm_get_dma_buf(substream); hsw_pcm_hw_params()
613 ret = create_adsp_page_table(substream, pdata, rtd, runtime->dma_area, hsw_pcm_hw_params()
627 pdata->dmab[rtd->cpu_dai->id][substream->stream].addr, hsw_pcm_hw_params()
668 static int hsw_pcm_hw_free(struct snd_pcm_substream *substream) hsw_pcm_hw_free() argument
670 snd_pcm_lib_free_pages(substream); hsw_pcm_hw_free()
674 static int hsw_pcm_trigger(struct snd_pcm_substream *substream, int cmd) hsw_pcm_trigger() argument
676 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_pcm_trigger()
682 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_trigger()
687 pcm_data = &pdata->pcm[dai][substream->stream]; hsw_pcm_trigger()
718 struct snd_pcm_substream *substream = pcm_data->substream; hsw_notify_pointer() local
719 struct snd_pcm_runtime *runtime = substream->runtime; hsw_notify_pointer()
720 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_notify_pointer()
742 || (substream->stream == SNDRV_PCM_STREAM_CAPTURE) hsw_notify_pointer()
744 snd_pcm_period_elapsed(substream); hsw_notify_pointer()
778 snd_pcm_period_elapsed(substream); hsw_notify_pointer()
782 static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_pcm_substream *substream) hsw_pcm_pointer() argument
784 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_pcm_pointer()
785 struct snd_pcm_runtime *runtime = substream->runtime; hsw_pcm_pointer()
796 pcm_data = &pdata->pcm[dai][substream->stream]; hsw_pcm_pointer()
807 static int hsw_pcm_open(struct snd_pcm_substream *substream) hsw_pcm_open() argument
809 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_pcm_open()
817 pcm_data = &pdata->pcm[dai][substream->stream]; hsw_pcm_open()
823 pcm_data->substream = substream; hsw_pcm_open()
825 snd_soc_set_runtime_hwparams(substream, &hsw_pcm_hardware); hsw_pcm_open()
841 static int hsw_pcm_close(struct snd_pcm_substream *substream) hsw_pcm_close() argument
843 struct snd_soc_pcm_runtime *rtd = substream->private_data; hsw_pcm_close()
851 pcm_data = &pdata->pcm[dai][substream->stream]; hsw_pcm_close()
947 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream || hsw_pcm_new()
948 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { hsw_pcm_new()
960 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) hsw_pcm_new()
962 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) hsw_pcm_new()
1307 if (!pcm_data->substream) hsw_pcm_complete()
1342 if (!pcm_data->substream) hsw_pcm_prepare()
1355 if (!pcm_data->substream) hsw_pcm_prepare()
/linux-4.1.27/sound/soc/sh/rcar/
H A Dcore.c287 struct snd_pcm_substream *substream = io->substream; rsnd_dai_pointer_offset() local
288 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_pointer_offset()
301 struct snd_pcm_substream *substream = io->substream; rsnd_dai_pointer_update() local
302 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_pointer_update()
313 snd_pcm_period_elapsed(substream); rsnd_dai_pointer_update()
318 struct snd_pcm_substream *substream) rsnd_dai_stream_init()
320 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_dai_stream_init()
322 io->substream = substream; rsnd_dai_stream_init()
334 struct snd_soc_dai *rsnd_substream_to_dai(struct snd_pcm_substream *substream) rsnd_substream_to_dai() argument
336 struct snd_soc_pcm_runtime *rtd = substream->private_data; rsnd_substream_to_dai()
343 struct snd_pcm_substream *substream) rsnd_rdai_to_io()
345 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) rsnd_rdai_to_io()
351 static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd, rsnd_soc_dai_trigger() argument
356 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); rsnd_soc_dai_trigger()
365 ret = rsnd_dai_stream_init(io, substream); rsnd_soc_dai_trigger()
715 static int rsnd_pcm_open(struct snd_pcm_substream *substream) rsnd_pcm_open() argument
717 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_pcm_open()
720 snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware); rsnd_pcm_open()
728 static int rsnd_hw_params(struct snd_pcm_substream *substream, rsnd_hw_params() argument
731 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream); rsnd_hw_params()
733 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); rsnd_hw_params()
736 ret = rsnd_dai_call(hw_params, io, substream, hw_params); rsnd_hw_params()
740 return snd_pcm_lib_malloc_pages(substream, rsnd_hw_params()
744 static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream) rsnd_pointer() argument
746 struct snd_pcm_runtime *runtime = substream->runtime; rsnd_pointer()
747 struct snd_soc_dai *dai = rsnd_substream_to_dai(substream); rsnd_pointer()
749 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); rsnd_pointer()
317 rsnd_dai_stream_init(struct rsnd_dai_stream *io, struct snd_pcm_substream *substream) rsnd_dai_stream_init() argument
342 rsnd_rdai_to_io(struct rsnd_dai *rdai, struct snd_pcm_substream *substream) rsnd_rdai_to_io() argument
/linux-4.1.27/drivers/media/usb/cx231xx/
H A Dcx231xx-audio.c104 struct snd_pcm_substream *substream; cx231xx_audio_isocirq() local
128 substream = dev->adev.capture_pcm_substream; cx231xx_audio_isocirq()
129 runtime = substream->runtime; cx231xx_audio_isocirq()
155 snd_pcm_stream_lock(substream); cx231xx_audio_isocirq()
170 snd_pcm_stream_unlock(substream); cx231xx_audio_isocirq()
173 snd_pcm_period_elapsed(substream); cx231xx_audio_isocirq()
194 struct snd_pcm_substream *substream; cx231xx_audio_bulkirq() local
218 substream = dev->adev.capture_pcm_substream; cx231xx_audio_bulkirq()
219 runtime = substream->runtime; cx231xx_audio_bulkirq()
241 snd_pcm_stream_lock(substream); cx231xx_audio_bulkirq()
256 snd_pcm_stream_unlock(substream); cx231xx_audio_bulkirq()
259 snd_pcm_period_elapsed(substream); cx231xx_audio_bulkirq()
433 static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream) snd_cx231xx_capture_open() argument
435 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_capture_open()
436 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx231xx_capture_open()
473 dev->adev.capture_pcm_substream = substream; snd_cx231xx_capture_open()
479 static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream) snd_cx231xx_pcm_close() argument
482 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_pcm_close()
517 static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream, snd_cx231xx_hw_capture_params() argument
520 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_hw_capture_params()
525 ret = snd_pcm_alloc_vmalloc_buffer(substream, snd_cx231xx_hw_capture_params()
541 static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream) snd_cx231xx_hw_capture_free() argument
543 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_hw_capture_free()
555 static int snd_cx231xx_prepare(struct snd_pcm_substream *substream) snd_cx231xx_prepare() argument
557 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_prepare()
583 static int snd_cx231xx_capture_trigger(struct snd_pcm_substream *substream, snd_cx231xx_capture_trigger() argument
586 struct cx231xx *dev = snd_pcm_substream_chip(substream); snd_cx231xx_capture_trigger()
612 *substream) snd_cx231xx_capture_pointer()
618 dev = snd_pcm_substream_chip(substream); snd_cx231xx_capture_pointer()
611 snd_cx231xx_capture_pointer(struct snd_pcm_substream *substream) snd_cx231xx_capture_pointer() argument
/linux-4.1.27/sound/pci/nm256/
H A Dnm256.c190 struct snd_pcm_substream *substream; member in struct:nm256_stream
199 int dma_size; /* buffer size of the substream in bytes */
430 struct snd_pcm_substream *substream) snd_nm256_set_format()
432 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_set_format()
448 switch (substream->stream) { snd_nm256_set_format()
513 struct snd_pcm_substream *substream) snd_nm256_playback_start()
530 struct snd_pcm_substream *substream) snd_nm256_capture_start()
562 snd_nm256_playback_trigger(struct snd_pcm_substream *substream, int cmd) snd_nm256_playback_trigger() argument
564 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_playback_trigger()
565 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_playback_trigger()
578 snd_nm256_playback_start(chip, s, substream); snd_nm256_playback_trigger()
600 snd_nm256_capture_trigger(struct snd_pcm_substream *substream, int cmd) snd_nm256_capture_trigger() argument
602 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_capture_trigger()
603 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_capture_trigger()
614 snd_nm256_capture_start(chip, s, substream); snd_nm256_capture_trigger()
637 static int snd_nm256_pcm_prepare(struct snd_pcm_substream *substream) snd_nm256_pcm_prepare() argument
639 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_pcm_prepare()
640 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_pcm_prepare()
645 s->dma_size = frames_to_bytes(runtime, substream->runtime->buffer_size); snd_nm256_pcm_prepare()
646 s->period_size = frames_to_bytes(runtime, substream->runtime->period_size); snd_nm256_pcm_prepare()
647 s->periods = substream->runtime->periods; snd_nm256_pcm_prepare()
652 snd_nm256_set_format(chip, s, substream); snd_nm256_pcm_prepare()
663 snd_nm256_playback_pointer(struct snd_pcm_substream *substream) snd_nm256_playback_pointer() argument
665 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_playback_pointer()
666 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_playback_pointer()
673 return bytes_to_frames(substream->runtime, curp); snd_nm256_playback_pointer()
677 snd_nm256_capture_pointer(struct snd_pcm_substream *substream) snd_nm256_capture_pointer() argument
679 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_capture_pointer()
680 struct nm256_stream *s = substream->runtime->private_data; snd_nm256_capture_pointer()
687 return bytes_to_frames(substream->runtime, curp); snd_nm256_capture_pointer()
697 snd_nm256_playback_silence(struct snd_pcm_substream *substream, snd_nm256_playback_silence() argument
702 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_playback_silence()
711 snd_nm256_playback_copy(struct snd_pcm_substream *substream, snd_nm256_playback_copy() argument
717 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_playback_copy()
730 snd_nm256_capture_copy(struct snd_pcm_substream *substream, snd_nm256_capture_copy() argument
736 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_capture_copy()
759 if (s->running && s->substream) { snd_nm256_playback_update()
761 snd_pcm_period_elapsed(s->substream); snd_nm256_playback_update()
774 if (s->running && s->substream) { snd_nm256_capture_update()
776 snd_pcm_period_elapsed(s->substream); snd_nm256_capture_update()
825 static int snd_nm256_pcm_hw_params(struct snd_pcm_substream *substream, snd_nm256_pcm_hw_params() argument
829 substream->runtime->dma_bytes = params_buffer_bytes(hw_params); snd_nm256_pcm_hw_params()
837 struct snd_pcm_substream *substream, snd_nm256_setup_stream()
840 struct snd_pcm_runtime *runtime = substream->runtime; snd_nm256_setup_stream()
850 s->substream = substream; snd_nm256_setup_stream()
857 snd_nm256_playback_open(struct snd_pcm_substream *substream) snd_nm256_playback_open() argument
859 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_playback_open()
864 substream, &snd_nm256_playback); snd_nm256_playback_open()
869 snd_nm256_capture_open(struct snd_pcm_substream *substream) snd_nm256_capture_open() argument
871 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_capture_open()
876 substream, &snd_nm256_capture); snd_nm256_capture_open()
884 snd_nm256_playback_close(struct snd_pcm_substream *substream) snd_nm256_playback_close() argument
886 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_playback_close()
894 snd_nm256_capture_close(struct snd_pcm_substream *substream) snd_nm256_capture_close() argument
896 struct nm256 *chip = snd_pcm_substream_chip(substream); snd_nm256_capture_close()
1421 if (s->substream && s->suspended) { nm256_resume()
1423 snd_nm256_set_format(chip, s, s->substream); nm256_resume()
429 snd_nm256_set_format(struct nm256 *chip, struct nm256_stream *s, struct snd_pcm_substream *substream) snd_nm256_set_format() argument
512 snd_nm256_playback_start(struct nm256 *chip, struct nm256_stream *s, struct snd_pcm_substream *substream) snd_nm256_playback_start() argument
529 snd_nm256_capture_start(struct nm256 *chip, struct nm256_stream *s, struct snd_pcm_substream *substream) snd_nm256_capture_start() argument
836 snd_nm256_setup_stream(struct nm256 *chip, struct nm256_stream *s, struct snd_pcm_substream *substream, struct snd_pcm_hardware *hw_ptr) snd_nm256_setup_stream() argument
/linux-4.1.27/sound/soc/adi/
H A Daxi-i2s.c55 static int axi_i2s_trigger(struct snd_pcm_substream *substream, int cmd, axi_i2s_trigger() argument
61 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) axi_i2s_trigger()
86 static int axi_i2s_hw_params(struct snd_pcm_substream *substream, axi_i2s_hw_params() argument
104 static int axi_i2s_startup(struct snd_pcm_substream *substream, axi_i2s_startup() argument
111 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) axi_i2s_startup()
118 ret = snd_pcm_hw_constraint_ratnums(substream->runtime, 0, axi_i2s_startup()
127 static void axi_i2s_shutdown(struct snd_pcm_substream *substream, axi_i2s_shutdown() argument
H A Daxi-spdif.c49 static int axi_spdif_trigger(struct snd_pcm_substream *substream, int cmd, axi_spdif_trigger() argument
76 static int axi_spdif_hw_params(struct snd_pcm_substream *substream, axi_spdif_hw_params() argument
118 static int axi_spdif_startup(struct snd_pcm_substream *substream, axi_spdif_startup() argument
124 ret = snd_pcm_hw_constraint_ratnums(substream->runtime, 0, axi_spdif_startup()
140 static void axi_spdif_shutdown(struct snd_pcm_substream *substream, axi_spdif_shutdown() argument
/linux-4.1.27/sound/soc/xtensa/
H A Dxtfpga-i2s.c66 /* current playback substream. NULL if not playing.
71 * Interrupt handler (threaded part) does PIO on substream data in RCU
273 static int xtfpga_i2s_startup(struct snd_pcm_substream *substream, xtfpga_i2s_startup() argument
278 snd_soc_dai_set_dma_data(dai, substream, i2s); xtfpga_i2s_startup()
282 static int xtfpga_i2s_hw_params(struct snd_pcm_substream *substream, xtfpga_i2s_hw_params() argument
371 static int xtfpga_pcm_open(struct snd_pcm_substream *substream) xtfpga_pcm_open() argument
373 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_open()
374 struct snd_soc_pcm_runtime *rtd = substream->private_data; xtfpga_pcm_open()
377 snd_soc_set_runtime_hwparams(substream, &xtfpga_pcm_hardware); xtfpga_pcm_open()
378 p = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); xtfpga_pcm_open()
384 static int xtfpga_pcm_close(struct snd_pcm_substream *substream) xtfpga_pcm_close() argument
390 static int xtfpga_pcm_hw_params(struct snd_pcm_substream *substream, xtfpga_pcm_hw_params() argument
394 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_hw_params()
425 ret = snd_pcm_lib_malloc_pages(substream, xtfpga_pcm_hw_params()
430 static int xtfpga_pcm_trigger(struct snd_pcm_substream *substream, int cmd) xtfpga_pcm_trigger() argument
433 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_trigger()
441 rcu_assign_pointer(i2s->tx_substream, substream); xtfpga_pcm_trigger()
458 static snd_pcm_uframes_t xtfpga_pcm_pointer(struct snd_pcm_substream *substream) xtfpga_pcm_pointer() argument
460 struct snd_pcm_runtime *runtime = substream->runtime; xtfpga_pcm_pointer()
/linux-4.1.27/drivers/media/pci/cx25821/
H A Dcx25821-alsa.c95 struct snd_pcm_substream *substream; member in struct:cx25821_audio_dev
356 snd_pcm_period_elapsed(chip->substream); cx25821_aud_irq()
458 static int snd_cx25821_pcm_open(struct snd_pcm_substream *substream) snd_cx25821_pcm_open() argument
460 struct cx25821_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx25821_pcm_open()
461 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx25821_pcm_open()
475 chip->substream = substream; snd_cx25821_pcm_open()
501 static int snd_cx25821_close(struct snd_pcm_substream *substream) snd_cx25821_close() argument
509 static int snd_cx25821_hw_params(struct snd_pcm_substream *substream, snd_cx25821_hw_params() argument
512 struct cx25821_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx25821_hw_params()
516 if (substream->runtime->dma_area) { snd_cx25821_hw_params()
518 substream->runtime->dma_area = NULL; snd_cx25821_hw_params()
559 substream->runtime->dma_area = chip->buf->vaddr; snd_cx25821_hw_params()
560 substream->runtime->dma_bytes = chip->dma_size; snd_cx25821_hw_params()
561 substream->runtime->dma_addr = 0; snd_cx25821_hw_params()
574 static int snd_cx25821_hw_free(struct snd_pcm_substream *substream) snd_cx25821_hw_free() argument
576 struct cx25821_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx25821_hw_free()
578 if (substream->runtime->dma_area) { snd_cx25821_hw_free()
580 substream->runtime->dma_area = NULL; snd_cx25821_hw_free()
589 static int snd_cx25821_prepare(struct snd_pcm_substream *substream) snd_cx25821_prepare() argument
597 static int snd_cx25821_card_trigger(struct snd_pcm_substream *substream, snd_cx25821_card_trigger() argument
600 struct cx25821_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx25821_card_trigger()
627 *substream) snd_cx25821_pointer()
629 struct cx25821_audio_dev *chip = snd_pcm_substream_chip(substream); snd_cx25821_pointer()
630 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx25821_pointer()
641 static struct page *snd_cx25821_page(struct snd_pcm_substream *substream, snd_cx25821_page() argument
644 void *pageptr = substream->runtime->dma_area + offset; snd_cx25821_page()
626 snd_cx25821_pointer(struct snd_pcm_substream *substream) snd_cx25821_pointer() argument
/linux-4.1.27/drivers/media/pci/cx88/
H A Dcx88-alsa.c92 struct snd_pcm_substream *substream; member in struct:cx88_audio_dev
252 snd_pcm_period_elapsed(chip->substream); cx8801_aud_irq()
421 static int snd_cx88_pcm_open(struct snd_pcm_substream *substream) snd_cx88_pcm_open() argument
423 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_cx88_pcm_open()
424 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx88_pcm_open()
437 chip->substream = substream; snd_cx88_pcm_open()
457 static int snd_cx88_close(struct snd_pcm_substream *substream) snd_cx88_close() argument
465 static int snd_cx88_hw_params(struct snd_pcm_substream * substream, snd_cx88_hw_params() argument
468 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_cx88_hw_params()
473 if (substream->runtime->dma_area) { snd_cx88_hw_params()
475 substream->runtime->dma_area = NULL; snd_cx88_hw_params()
510 substream->runtime->dma_area = chip->buf->vaddr; snd_cx88_hw_params()
511 substream->runtime->dma_bytes = chip->dma_size; snd_cx88_hw_params()
512 substream->runtime->dma_addr = 0; snd_cx88_hw_params()
523 static int snd_cx88_hw_free(struct snd_pcm_substream * substream) snd_cx88_hw_free() argument
526 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_cx88_hw_free()
528 if (substream->runtime->dma_area) { snd_cx88_hw_free()
530 substream->runtime->dma_area = NULL; snd_cx88_hw_free()
539 static int snd_cx88_prepare(struct snd_pcm_substream *substream) snd_cx88_prepare() argument
547 static int snd_cx88_card_trigger(struct snd_pcm_substream *substream, int cmd) snd_cx88_card_trigger() argument
549 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_cx88_card_trigger()
575 static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream) snd_cx88_pointer() argument
577 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_cx88_pointer()
578 struct snd_pcm_runtime *runtime = substream->runtime; snd_cx88_pointer()
592 static struct page *snd_cx88_page(struct snd_pcm_substream *substream, snd_cx88_page() argument
595 void *pageptr = substream->runtime->dma_area + offset; snd_cx88_page()
/linux-4.1.27/sound/isa/es1688/
H A Des1688_lib.c313 static void snd_es1688_set_rate(struct snd_es1688 *chip, struct snd_pcm_substream *substream) snd_es1688_set_rate() argument
315 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_set_rate()
329 static int snd_es1688_ioctl(struct snd_pcm_substream *substream, snd_es1688_ioctl() argument
332 return snd_pcm_lib_ioctl(substream, cmd, arg); snd_es1688_ioctl()
361 static int snd_es1688_hw_params(struct snd_pcm_substream *substream, snd_es1688_hw_params() argument
364 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_es1688_hw_params()
367 static int snd_es1688_hw_free(struct snd_pcm_substream *substream) snd_es1688_hw_free() argument
369 return snd_pcm_lib_free_pages(substream); snd_es1688_hw_free()
372 static int snd_es1688_playback_prepare(struct snd_pcm_substream *substream) snd_es1688_playback_prepare() argument
375 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_playback_prepare()
376 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_playback_prepare()
377 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es1688_playback_prepare()
378 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es1688_playback_prepare()
383 snd_es1688_set_rate(chip, substream); snd_es1688_playback_prepare()
426 static int snd_es1688_playback_trigger(struct snd_pcm_substream *substream, snd_es1688_playback_trigger() argument
429 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_playback_trigger()
433 static int snd_es1688_capture_prepare(struct snd_pcm_substream *substream) snd_es1688_capture_prepare() argument
436 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_capture_prepare()
437 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_capture_prepare()
438 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es1688_capture_prepare()
439 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es1688_capture_prepare()
444 snd_es1688_set_rate(chip, substream); snd_es1688_capture_prepare()
483 static int snd_es1688_capture_trigger(struct snd_pcm_substream *substream, snd_es1688_capture_trigger() argument
486 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_capture_trigger()
503 static snd_pcm_uframes_t snd_es1688_playback_pointer(struct snd_pcm_substream *substream) snd_es1688_playback_pointer() argument
505 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_playback_pointer()
511 return bytes_to_frames(substream->runtime, ptr); snd_es1688_playback_pointer()
514 static snd_pcm_uframes_t snd_es1688_capture_pointer(struct snd_pcm_substream *substream) snd_es1688_capture_pointer() argument
516 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_capture_pointer()
522 return bytes_to_frames(substream->runtime, ptr); snd_es1688_capture_pointer()
569 static int snd_es1688_playback_open(struct snd_pcm_substream *substream) snd_es1688_playback_open() argument
571 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_playback_open()
572 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_playback_open()
576 chip->playback_substream = substream; snd_es1688_playback_open()
583 static int snd_es1688_capture_open(struct snd_pcm_substream *substream) snd_es1688_capture_open() argument
585 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_capture_open()
586 struct snd_pcm_runtime *runtime = substream->runtime; snd_es1688_capture_open()
590 chip->capture_substream = substream; snd_es1688_capture_open()
597 static int snd_es1688_playback_close(struct snd_pcm_substream *substream) snd_es1688_playback_close() argument
599 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_playback_close()
605 static int snd_es1688_capture_close(struct snd_pcm_substream *substream) snd_es1688_capture_close() argument
607 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); snd_es1688_capture_close()
/linux-4.1.27/sound/firewire/
H A Disight.c246 static int isight_open(struct snd_pcm_substream *substream) isight_open() argument
266 struct isight *isight = substream->private_data; isight_open()
268 substream->runtime->hw = hardware; isight_open()
276 static int isight_close(struct snd_pcm_substream *substream) isight_close() argument
278 struct isight *isight = substream->private_data; isight_close()
285 static int isight_hw_params(struct snd_pcm_substream *substream, isight_hw_params() argument
288 struct isight *isight = substream->private_data; isight_hw_params()
291 err = snd_pcm_lib_alloc_vmalloc_buffer(substream, isight_hw_params()
330 static int isight_hw_free(struct snd_pcm_substream *substream) isight_hw_free() argument
332 struct isight *isight = substream->private_data; isight_hw_free()
340 return snd_pcm_lib_free_vmalloc_buffer(substream); isight_hw_free()
406 static int isight_prepare(struct snd_pcm_substream *substream) isight_prepare() argument
408 struct isight *isight = substream->private_data; isight_prepare()
421 static int isight_trigger(struct snd_pcm_substream *substream, int cmd) isight_trigger() argument
423 struct isight *isight = substream->private_data; isight_trigger()
438 static snd_pcm_uframes_t isight_pointer(struct snd_pcm_substream *substream) isight_pointer() argument
440 struct isight *isight = substream->private_data; isight_pointer()
467 isight->pcm = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; isight_create_pcm()
/linux-4.1.27/sound/usb/bcd2000/
H A Dbcd2000.c87 static int bcd2000_midi_input_open(struct snd_rawmidi_substream *substream) bcd2000_midi_input_open() argument
92 static int bcd2000_midi_input_close(struct snd_rawmidi_substream *substream) bcd2000_midi_input_close() argument
97 /* (de)register midi substream from client */ bcd2000_midi_input_trigger()
98 static void bcd2000_midi_input_trigger(struct snd_rawmidi_substream *substream, bcd2000_midi_input_trigger() argument
101 struct bcd2000 *bcd2k = substream->rmidi->private_data; bcd2000_midi_input_trigger()
102 bcd2k->midi_receive_substream = up ? substream : NULL; bcd2000_midi_input_trigger()
181 static int bcd2000_midi_output_open(struct snd_rawmidi_substream *substream) bcd2000_midi_output_open() argument
186 static int bcd2000_midi_output_close(struct snd_rawmidi_substream *substream) bcd2000_midi_output_close() argument
188 struct bcd2000 *bcd2k = substream->rmidi->private_data; bcd2000_midi_output_close()
198 /* (de)register midi substream from client */ bcd2000_midi_output_trigger()
199 static void bcd2000_midi_output_trigger(struct snd_rawmidi_substream *substream, bcd2000_midi_output_trigger() argument
202 struct bcd2000 *bcd2k = substream->rmidi->private_data; bcd2000_midi_output_trigger()
205 bcd2k->midi_out_substream = substream; bcd2000_midi_output_trigger()
/linux-4.1.27/drivers/media/usb/em28xx/
H A Dem28xx-audio.c90 struct snd_pcm_substream *substream; em28xx_audio_isocirq() local
116 substream = dev->adev.capture_pcm_substream; em28xx_audio_isocirq()
117 runtime = substream->runtime; em28xx_audio_isocirq()
142 snd_pcm_stream_lock(substream); em28xx_audio_isocirq()
158 snd_pcm_stream_unlock(substream); em28xx_audio_isocirq()
161 snd_pcm_period_elapsed(substream); em28xx_audio_isocirq()
250 static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) snd_em28xx_capture_open() argument
252 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_capture_open()
253 struct snd_pcm_runtime *runtime = substream->runtime; snd_em28xx_capture_open()
267 nonblock = !!(substream->f_flags & O_NONBLOCK); snd_em28xx_capture_open()
315 dev->adev.capture_pcm_substream = substream; snd_em28xx_capture_open()
325 static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) snd_em28xx_pcm_close() argument
327 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_pcm_close()
340 if (substream->runtime->dma_area) { snd_em28xx_pcm_close()
342 vfree(substream->runtime->dma_area); snd_em28xx_pcm_close()
343 substream->runtime->dma_area = NULL; snd_em28xx_pcm_close()
351 static int snd_em28xx_hw_capture_params(struct snd_pcm_substream *substream, snd_em28xx_hw_capture_params() argument
355 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_hw_capture_params()
362 ret = snd_pcm_alloc_vmalloc_buffer(substream, snd_em28xx_hw_capture_params()
380 static int snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream) snd_em28xx_hw_capture_free() argument
382 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_hw_capture_free()
395 static int snd_em28xx_prepare(struct snd_pcm_substream *substream) snd_em28xx_prepare() argument
397 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_prepare()
423 static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, snd_em28xx_capture_trigger() argument
426 struct em28xx *dev = snd_pcm_substream_chip(substream); snd_em28xx_capture_trigger()
451 *substream) snd_em28xx_capture_pointer()
457 dev = snd_pcm_substream_chip(substream); snd_em28xx_capture_pointer()
499 struct snd_pcm_substream *substream = dev->adev.capture_pcm_substream; em28xx_vol_put() local
508 if (substream) em28xx_vol_put()
509 nonblock = !!(substream->f_flags & O_NONBLOCK); em28xx_vol_put()
539 struct snd_pcm_substream *substream = dev->adev.capture_pcm_substream; em28xx_vol_get() local
546 if (substream) em28xx_vol_get()
547 nonblock = !!(substream->f_flags & O_NONBLOCK); em28xx_vol_get()
574 struct snd_pcm_substream *substream = dev->adev.capture_pcm_substream; em28xx_vol_put_mute() local
581 if (substream) em28xx_vol_put_mute()
582 nonblock = !!(substream->f_flags & O_NONBLOCK); em28xx_vol_put_mute()
615 struct snd_pcm_substream *substream = dev->adev.capture_pcm_substream; em28xx_vol_get_mute() local
622 if (substream) em28xx_vol_get_mute()
623 nonblock = !!(substream->f_flags & O_NONBLOCK); em28xx_vol_get_mute()
450 snd_em28xx_capture_pointer(struct snd_pcm_substream *substream) snd_em28xx_capture_pointer() argument
/linux-4.1.27/sound/isa/
H A Des18xx.c414 struct snd_pcm_substream *substream, snd_es18xx_rate_set()
418 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_rate_set()
448 static int snd_es18xx_playback_hw_params(struct snd_pcm_substream *substream, snd_es18xx_playback_hw_params() argument
451 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_hw_params()
460 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { snd_es18xx_playback_hw_params()
471 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_es18xx_playback_hw_params()
476 static int snd_es18xx_pcm_hw_free(struct snd_pcm_substream *substream) snd_es18xx_pcm_hw_free() argument
478 return snd_pcm_lib_free_pages(substream); snd_es18xx_pcm_hw_free()
482 struct snd_pcm_substream *substream) snd_es18xx_playback1_prepare()
484 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback1_prepare()
485 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es18xx_playback1_prepare()
486 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es18xx_playback1_prepare()
488 snd_es18xx_rate_set(chip, substream, DAC2); snd_es18xx_playback1_prepare()
508 struct snd_pcm_substream *substream, snd_es18xx_playback1_trigger()
557 static int snd_es18xx_capture_hw_params(struct snd_pcm_substream *substream, snd_es18xx_capture_hw_params() argument
560 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_hw_params()
575 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_es18xx_capture_hw_params()
580 static int snd_es18xx_capture_prepare(struct snd_pcm_substream *substream) snd_es18xx_capture_prepare() argument
582 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_prepare()
583 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_capture_prepare()
584 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es18xx_capture_prepare()
585 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es18xx_capture_prepare()
592 snd_es18xx_rate_set(chip, substream, ADC1); snd_es18xx_capture_prepare()
617 static int snd_es18xx_capture_trigger(struct snd_pcm_substream *substream, snd_es18xx_capture_trigger() argument
620 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_trigger()
647 struct snd_pcm_substream *substream) snd_es18xx_playback2_prepare()
649 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback2_prepare()
650 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es18xx_playback2_prepare()
651 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_es18xx_playback2_prepare()
658 snd_es18xx_rate_set(chip, substream, DAC1); snd_es18xx_playback2_prepare()
682 struct snd_pcm_substream *substream, snd_es18xx_playback2_trigger()
721 static int snd_es18xx_playback_prepare(struct snd_pcm_substream *substream) snd_es18xx_playback_prepare() argument
723 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_prepare()
724 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) snd_es18xx_playback_prepare()
725 return snd_es18xx_playback1_prepare(chip, substream); snd_es18xx_playback_prepare()
727 return snd_es18xx_playback2_prepare(chip, substream); snd_es18xx_playback_prepare()
730 static int snd_es18xx_playback_trigger(struct snd_pcm_substream *substream, snd_es18xx_playback_trigger() argument
733 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_trigger()
734 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) snd_es18xx_playback_trigger()
735 return snd_es18xx_playback1_trigger(chip, substream, cmd); snd_es18xx_playback_trigger()
737 return snd_es18xx_playback2_trigger(chip, substream, cmd); snd_es18xx_playback_trigger()
810 static snd_pcm_uframes_t snd_es18xx_playback_pointer(struct snd_pcm_substream *substream) snd_es18xx_playback_pointer() argument
812 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_pointer()
813 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es18xx_playback_pointer()
816 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { snd_es18xx_playback_pointer()
829 static snd_pcm_uframes_t snd_es18xx_capture_pointer(struct snd_pcm_substream *substream) snd_es18xx_capture_pointer() argument
831 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_pointer()
832 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_es18xx_capture_pointer()
881 static int snd_es18xx_playback_open(struct snd_pcm_substream *substream) snd_es18xx_playback_open() argument
883 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_playback_open()
884 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_open()
886 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) { snd_es18xx_playback_open()
891 chip->playback_a_substream = substream; snd_es18xx_playback_open()
892 } else if (substream->number <= 1) { snd_es18xx_playback_open()
895 chip->playback_b_substream = substream; snd_es18xx_playback_open()
900 substream->runtime->hw = snd_es18xx_playback; snd_es18xx_playback_open()
906 static int snd_es18xx_capture_open(struct snd_pcm_substream *substream) snd_es18xx_capture_open() argument
908 struct snd_pcm_runtime *runtime = substream->runtime; snd_es18xx_capture_open()
909 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_open()
917 chip->capture_a_substream = substream; snd_es18xx_capture_open()
918 substream->runtime->hw = snd_es18xx_capture; snd_es18xx_capture_open()
924 static int snd_es18xx_playback_close(struct snd_pcm_substream *substream) snd_es18xx_playback_close() argument
926 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_playback_close()
928 if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) snd_es18xx_playback_close()
933 snd_pcm_lib_free_pages(substream); snd_es18xx_playback_close()
937 static int snd_es18xx_capture_close(struct snd_pcm_substream *substream) snd_es18xx_capture_close() argument
939 struct snd_es18xx *chip = snd_pcm_substream_chip(substream); snd_es18xx_capture_close()
942 snd_pcm_lib_free_pages(substream); snd_es18xx_capture_close()
413 snd_es18xx_rate_set(struct snd_es18xx *chip, struct snd_pcm_substream *substream, int mode) snd_es18xx_rate_set() argument
481 snd_es18xx_playback1_prepare(struct snd_es18xx *chip, struct snd_pcm_substream *substream) snd_es18xx_playback1_prepare() argument
507 snd_es18xx_playback1_trigger(struct snd_es18xx *chip, struct snd_pcm_substream *substream, int cmd) snd_es18xx_playback1_trigger() argument
646 snd_es18xx_playback2_prepare(struct snd_es18xx *chip, struct snd_pcm_substream *substream) snd_es18xx_playback2_prepare() argument
681 snd_es18xx_playback2_trigger(struct snd_es18xx *chip, struct snd_pcm_substream *substream, int cmd) snd_es18xx_playback2_trigger() argument
/linux-4.1.27/sound/usb/
H A Dproc.c156 if (stream->substream[SNDRV_PCM_STREAM_PLAYBACK].num_formats) { proc_pcm_format_read()
158 proc_dump_substream_status(&stream->substream[SNDRV_PCM_STREAM_PLAYBACK], buffer); proc_pcm_format_read()
159 proc_dump_substream_formats(&stream->substream[SNDRV_PCM_STREAM_PLAYBACK], buffer); proc_pcm_format_read()
161 if (stream->substream[SNDRV_PCM_STREAM_CAPTURE].num_formats) { proc_pcm_format_read()
163 proc_dump_substream_status(&stream->substream[SNDRV_PCM_STREAM_CAPTURE], buffer); proc_pcm_format_read()
164 proc_dump_substream_formats(&stream->substream[SNDRV_PCM_STREAM_CAPTURE], buffer); proc_pcm_format_read()
H A Dmidi.c151 struct snd_rawmidi_substream *substream; member in struct:snd_usb_midi_out_endpoint::usbmidi_out_port
173 struct snd_rawmidi_substream *substream; member in struct:snd_usb_midi_in_endpoint::usbmidi_in_port
231 if (!port->substream) { snd_usbmidi_input_data()
235 if (!test_bit(port->substream->number, &ep->umidi->input_triggered)) snd_usbmidi_input_data()
237 snd_rawmidi_receive(port->substream, data, length); snd_usbmidi_input_data()
665 if (snd_rawmidi_transmit(port->substream, &b, 1) != 1) { snd_usbmidi_standard_output()
742 struct snd_rawmidi_substream *substream = ep->ports[0].substream; snd_usbmidi_akai_output() local
752 count = snd_rawmidi_transmit_peek(substream, snd_usbmidi_akai_output()
763 snd_rawmidi_transmit_ack(substream, pos); snd_usbmidi_akai_output()
774 snd_rawmidi_transmit_ack(substream, end); snd_usbmidi_akai_output()
783 snd_rawmidi_transmit_ack(substream, count); snd_usbmidi_akai_output()
794 snd_rawmidi_transmit_ack(substream, count); snd_usbmidi_akai_output()
826 count = snd_rawmidi_transmit(ep->ports[0].substream, snd_usbmidi_novation_output()
860 count = snd_rawmidi_transmit(ep->ports[0].substream, snd_usbmidi_raw_output()
918 count = snd_rawmidi_transmit(ep->ports[0].substream, snd_usbmidi_us122l_output()
1031 if (snd_rawmidi_transmit_peek(port->substream, buf, 1) != 1) { snd_usbmidi_emagic_output()
1048 length = snd_rawmidi_transmit(port->substream, buf, buf_free); snd_usbmidi_emagic_output()
1090 static int substream_open(struct snd_rawmidi_substream *substream, int dir, substream_open() argument
1093 struct snd_usb_midi *umidi = substream->rmidi->private_data; substream_open()
1136 static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) snd_usbmidi_output_open() argument
1138 struct snd_usb_midi *umidi = substream->rmidi->private_data; snd_usbmidi_output_open()
1145 if (umidi->endpoints[i].out->ports[j].substream == substream) { snd_usbmidi_output_open()
1154 substream->runtime->private_data = port; snd_usbmidi_output_open()
1156 return substream_open(substream, 0, 1); snd_usbmidi_output_open()
1159 static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) snd_usbmidi_output_close() argument
1161 return substream_open(substream, 0, 0); snd_usbmidi_output_close()
1164 static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, snd_usbmidi_output_trigger() argument
1168 (struct usbmidi_out_port *)substream->runtime->private_data; snd_usbmidi_output_trigger()
1175 while (!snd_rawmidi_transmit_empty(substream)) snd_usbmidi_output_trigger()
1176 snd_rawmidi_transmit_ack(substream, 1); snd_usbmidi_output_trigger()
1183 static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream) snd_usbmidi_output_drain() argument
1185 struct usbmidi_out_port *port = substream->runtime->private_data; snd_usbmidi_output_drain()
1194 * The substream buffer is empty, but some data might still be in the snd_usbmidi_output_drain()
1214 static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream) snd_usbmidi_input_open() argument
1216 return substream_open(substream, 1, 1); snd_usbmidi_input_open()
1219 static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream) snd_usbmidi_input_close() argument
1221 return substream_open(substream, 1, 0); snd_usbmidi_input_close()
1224 static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, snd_usbmidi_input_trigger() argument
1227 struct snd_usb_midi *umidi = substream->rmidi->private_data; snd_usbmidi_input_trigger()
1230 set_bit(substream->number, &umidi->input_triggered); snd_usbmidi_input_trigger()
1232 clear_bit(substream->number, &umidi->input_triggered); snd_usbmidi_input_trigger()
1518 struct snd_rawmidi_substream *substream; snd_usbmidi_find_substream() local
1520 list_for_each_entry(substream, &umidi->rmidi->streams[stream].substreams, snd_usbmidi_find_substream()
1522 if (substream->number == number) snd_usbmidi_find_substream()
1523 return substream; snd_usbmidi_find_substream()
1741 struct snd_rawmidi_substream *substream = snd_usbmidi_init_substream() local
1743 if (!substream) { snd_usbmidi_init_substream()
1744 dev_err(&umidi->dev->dev, "substream %d:%d not found\n", stream, snd_usbmidi_init_substream()
1752 snprintf(substream->name, sizeof(substream->name), snd_usbmidi_init_substream()
1755 *rsubstream = substream; snd_usbmidi_init_substream()
1788 &umidi->endpoints[i].out->ports[j].substream); snd_usbmidi_create_endpoints()
1795 &umidi->endpoints[i].in->ports[j].substream); snd_usbmidi_create_endpoints()
2196 &umidi->endpoints[cable & 1].out->ports[cable].substream); snd_usbmidi_create_endpoints_midiman()
2201 &umidi->endpoints[0].in->ports[cable].substream); snd_usbmidi_create_endpoints_midiman()
H A Dpcm.c77 static snd_pcm_uframes_t snd_usb_pcm_pointer(struct snd_pcm_substream *substream) snd_usb_pcm_pointer() argument
82 subs = (struct snd_usb_substream *)substream->runtime->private_data; snd_usb_pcm_pointer()
87 substream->runtime->delay = snd_usb_pcm_delay(subs, snd_usb_pcm_pointer()
88 substream->runtime->rate); snd_usb_pcm_pointer()
90 return hwptr_done / (substream->runtime->frame_bits >> 3); snd_usb_pcm_pointer()
590 &subs->stream->substream[subs->direction ^ 1]; configure_sync_endpoint()
685 static int snd_usb_hw_params(struct snd_pcm_substream *substream, snd_usb_hw_params() argument
688 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_hw_params()
692 ret = snd_pcm_lib_alloc_vmalloc_buffer(substream, snd_usb_hw_params()
732 static int snd_usb_hw_free(struct snd_pcm_substream *substream) snd_usb_hw_free() argument
734 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_hw_free()
745 return snd_pcm_lib_free_vmalloc_buffer(substream); snd_usb_hw_free()
753 static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) snd_usb_pcm_prepare() argument
755 struct snd_pcm_runtime *runtime = substream->runtime; snd_usb_pcm_prepare()
1191 static int snd_usb_pcm_open(struct snd_pcm_substream *substream, int direction) snd_usb_pcm_open() argument
1193 struct snd_usb_stream *as = snd_pcm_substream_chip(substream); snd_usb_pcm_open()
1194 struct snd_pcm_runtime *runtime = substream->runtime; snd_usb_pcm_open()
1195 struct snd_usb_substream *subs = &as->substream[direction]; snd_usb_pcm_open()
1201 subs->pcm_substream = substream; snd_usb_pcm_open()
1212 static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction) snd_usb_pcm_close() argument
1214 struct snd_usb_stream *as = snd_pcm_substream_chip(substream); snd_usb_pcm_close()
1215 struct snd_usb_substream *subs = &as->substream[direction]; snd_usb_pcm_close()
1534 static int snd_usb_playback_open(struct snd_pcm_substream *substream) snd_usb_playback_open() argument
1536 return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_PLAYBACK); snd_usb_playback_open()
1539 static int snd_usb_playback_close(struct snd_pcm_substream *substream) snd_usb_playback_close() argument
1541 return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_PLAYBACK); snd_usb_playback_close()
1544 static int snd_usb_capture_open(struct snd_pcm_substream *substream) snd_usb_capture_open() argument
1546 return snd_usb_pcm_open(substream, SNDRV_PCM_STREAM_CAPTURE); snd_usb_capture_open()
1549 static int snd_usb_capture_close(struct snd_pcm_substream *substream) snd_usb_capture_close() argument
1551 return snd_usb_pcm_close(substream, SNDRV_PCM_STREAM_CAPTURE); snd_usb_capture_close()
1554 static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substream, snd_usb_substream_playback_trigger() argument
1557 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_substream_playback_trigger()
1582 static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, snd_usb_substream_capture_trigger() argument
1586 struct snd_usb_substream *subs = substream->runtime->private_data; snd_usb_substream_capture_trigger()
/linux-4.1.27/drivers/media/pci/saa7134/
H A Dsaa7134-alsa.c96 struct snd_pcm_substream *substream; member in struct:snd_card_saa7134_pcm
176 snd_pcm_stop_xrun(dev->dmasound.substream); saa7134_irq_alsa_done()
194 if (dev->dmasound.read_count >= snd_pcm_lib_period_bytes(dev->dmasound.substream)) { saa7134_irq_alsa_done()
196 snd_pcm_period_elapsed(dev->dmasound.substream); saa7134_irq_alsa_done()
253 static int snd_card_saa7134_capture_trigger(struct snd_pcm_substream * substream, snd_card_saa7134_capture_trigger() argument
256 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_trigger()
518 static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream) snd_card_saa7134_capture_prepare() argument
520 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_prepare()
523 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); snd_card_saa7134_capture_prepare()
527 pcm->dev->dmasound.substream = substream; snd_card_saa7134_capture_prepare()
612 snd_card_saa7134_capture_pointer(struct snd_pcm_substream * substream) snd_card_saa7134_capture_pointer() argument
614 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_pointer()
619 dev->dmasound.read_count -= snd_pcm_lib_period_bytes(substream); snd_card_saa7134_capture_pointer()
620 dev->dmasound.read_offset += snd_pcm_lib_period_bytes(substream); snd_card_saa7134_capture_pointer()
682 static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, snd_card_saa7134_hw_params() argument
685 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); snd_card_saa7134_hw_params()
707 if (substream->runtime->dma_area) { snd_card_saa7134_hw_params()
711 substream->runtime->dma_area = NULL; snd_card_saa7134_hw_params()
749 substream->runtime->dma_area = dev->dmasound.vaddr; snd_card_saa7134_hw_params()
750 substream->runtime->dma_bytes = dev->dmasound.bufsize; snd_card_saa7134_hw_params()
751 substream->runtime->dma_addr = 0; snd_card_saa7134_hw_params()
767 static int snd_card_saa7134_hw_free(struct snd_pcm_substream * substream) snd_card_saa7134_hw_free() argument
769 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); snd_card_saa7134_hw_free()
774 if (substream->runtime->dma_area) { snd_card_saa7134_hw_free()
778 substream->runtime->dma_area = NULL; snd_card_saa7134_hw_free()
793 static int snd_card_saa7134_capture_close(struct snd_pcm_substream * substream) snd_card_saa7134_capture_close() argument
795 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); snd_card_saa7134_capture_close()
815 static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) snd_card_saa7134_capture_open() argument
817 struct snd_pcm_runtime *runtime = substream->runtime; snd_card_saa7134_capture_open()
819 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); snd_card_saa7134_capture_open()
849 pcm->substream = substream; snd_card_saa7134_capture_open()
877 static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream, snd_card_saa7134_page() argument
880 void *pageptr = substream->runtime->dma_area + offset; snd_card_saa7134_page()
/linux-4.1.27/sound/pci/ali5451/
H A Dali5451.c196 struct snd_pcm_substream *substream; member in struct:snd_ali_voice
867 if (pvoice->pcm && pvoice->substream) { snd_ali_update_ptr()
875 snd_pcm_period_elapsed(pvoice->substream); snd_ali_update_ptr()
971 pvoice->substream = NULL; snd_ali_free_voice()
1059 static unsigned int snd_ali_control_mode(struct snd_pcm_substream *substream) snd_ali_control_mode() argument
1062 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_control_mode()
1081 static int snd_ali_trigger(struct snd_pcm_substream *substream, snd_ali_trigger() argument
1085 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_trigger()
1106 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1126 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
1148 static int snd_ali_playback_hw_params(struct snd_pcm_substream *substream, snd_ali_playback_hw_params() argument
1151 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_playback_hw_params()
1152 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_hw_params()
1157 err = snd_pcm_lib_malloc_pages(substream, snd_ali_playback_hw_params()
1173 evoice->substream = substream; snd_ali_playback_hw_params()
1185 static int snd_ali_playback_hw_free(struct snd_pcm_substream *substream) snd_ali_playback_hw_free() argument
1187 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_playback_hw_free()
1188 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_hw_free()
1192 snd_pcm_lib_free_pages(substream); snd_ali_playback_hw_free()
1200 static int snd_ali_hw_params(struct snd_pcm_substream *substream, snd_ali_hw_params() argument
1203 return snd_pcm_lib_malloc_pages(substream, snd_ali_hw_params()
1207 static int snd_ali_hw_free(struct snd_pcm_substream *substream) snd_ali_hw_free() argument
1209 return snd_pcm_lib_free_pages(substream); snd_ali_hw_free()
1212 static int snd_ali_playback_prepare(struct snd_pcm_substream *substream) snd_ali_playback_prepare() argument
1214 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_playback_prepare()
1215 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_prepare()
1261 CTRL = snd_ali_control_mode(substream); snd_ali_playback_prepare()
1305 static int snd_ali_prepare(struct snd_pcm_substream *substream) snd_ali_prepare() argument
1307 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_prepare()
1308 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_prepare()
1368 CTRL = snd_ali_control_mode(substream); snd_ali_prepare()
1394 snd_ali_playback_pointer(struct snd_pcm_substream *substream) snd_ali_playback_pointer() argument
1396 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_playback_pointer()
1397 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_playback_pointer()
1415 static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream) snd_ali_pointer() argument
1417 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_pointer()
1418 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_pointer()
1493 static int snd_ali_open(struct snd_pcm_substream *substream, int rec, snd_ali_open() argument
1496 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_open()
1497 struct snd_pcm_runtime *runtime = substream->runtime; snd_ali_open()
1505 pvoice->substream = substream; snd_ali_open()
1510 snd_pcm_set_sync(substream); snd_ali_open()
1516 static int snd_ali_playback_open(struct snd_pcm_substream *substream) snd_ali_playback_open() argument
1518 return snd_ali_open(substream, 0, -1, &snd_ali_playback); snd_ali_playback_open()
1521 static int snd_ali_capture_open(struct snd_pcm_substream *substream) snd_ali_capture_open() argument
1523 return snd_ali_open(substream, 1, -1, &snd_ali_capture); snd_ali_capture_open()
1526 static int snd_ali_playback_close(struct snd_pcm_substream *substream) snd_ali_playback_close() argument
1531 static int snd_ali_close(struct snd_pcm_substream *substream) snd_ali_close() argument
1533 struct snd_ali *codec = snd_pcm_substream_chip(substream); snd_ali_close()
1534 struct snd_ali_voice *pvoice = substream->runtime->private_data; snd_ali_close()
1567 static int snd_ali_modem_hw_params(struct snd_pcm_substream *substream, snd_ali_modem_hw_params() argument
1570 struct snd_ali *chip = snd_pcm_substream_chip(substream); snd_ali_modem_hw_params()
1575 return snd_ali_hw_params(substream, hw_params); snd_ali_modem_hw_params()
1600 static int snd_ali_modem_open(struct snd_pcm_substream *substream, int rec, snd_ali_modem_open() argument
1609 int err = snd_ali_open(substream, rec, channel, &snd_ali_modem); snd_ali_modem_open()
1613 return snd_pcm_hw_constraint_list(substream->runtime, 0, snd_ali_modem_open()
1617 static int snd_ali_modem_playback_open(struct snd_pcm_substream *substream) snd_ali_modem_playback_open() argument
1619 return snd_ali_modem_open(substream, 0, ALI_MODEM_OUT_CHANNEL); snd_ali_modem_playback_open()
1622 static int snd_ali_modem_capture_open(struct snd_pcm_substream *substream) snd_ali_modem_capture_open() argument
1624 return snd_ali_modem_open(substream, 1, ALI_MODEM_IN_CHANNEL); snd_ali_modem_capture_open()
/linux-4.1.27/sound/sparc/
H A Dcs4231.c423 struct snd_pcm_substream *substream, snd_cs4231_advance_dma()
426 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_advance_dma()
429 unsigned int period_size = snd_pcm_lib_period_bytes(substream); snd_cs4231_advance_dma()
442 static void cs4231_dma_trigger(struct snd_pcm_substream *substream, cs4231_dma_trigger() argument
445 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); cs4231_dma_trigger()
474 static int snd_cs4231_trigger(struct snd_pcm_substream *substream, int cmd) snd_cs4231_trigger() argument
476 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_trigger()
487 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
490 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
493 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
499 cs4231_dma_trigger(substream, what, 1);
502 cs4231_dma_trigger(substream, what, 0);
886 static int snd_cs4231_playback_hw_params(struct snd_pcm_substream *substream, snd_cs4231_playback_hw_params() argument
889 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_playback_hw_params()
893 err = snd_pcm_lib_malloc_pages(substream, snd_cs4231_playback_hw_params()
905 static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream) snd_cs4231_playback_prepare() argument
907 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_playback_prepare()
908 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_playback_prepare()
930 static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream, snd_cs4231_capture_hw_params() argument
933 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_capture_hw_params()
937 err = snd_pcm_lib_malloc_pages(substream, snd_cs4231_capture_hw_params()
949 static int snd_cs4231_capture_prepare(struct snd_pcm_substream *substream) snd_cs4231_capture_prepare() argument
951 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_capture_prepare()
998 struct snd_pcm_substream *substream) snd_cs4231_playback_pointer()
1000 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_playback_pointer()
1008 ptr -= substream->runtime->dma_addr; snd_cs4231_playback_pointer()
1010 return bytes_to_frames(substream->runtime, ptr); snd_cs4231_playback_pointer()
1014 struct snd_pcm_substream *substream) snd_cs4231_capture_pointer()
1016 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_capture_pointer()
1024 ptr -= substream->runtime->dma_addr; snd_cs4231_capture_pointer()
1026 return bytes_to_frames(substream->runtime, ptr); snd_cs4231_capture_pointer()
1140 static int snd_cs4231_playback_open(struct snd_pcm_substream *substream) snd_cs4231_playback_open() argument
1142 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_playback_open()
1143 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_playback_open()
1153 chip->playback_substream = substream; snd_cs4231_playback_open()
1155 snd_pcm_set_sync(substream); snd_cs4231_playback_open()
1161 static int snd_cs4231_capture_open(struct snd_pcm_substream *substream) snd_cs4231_capture_open() argument
1163 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_capture_open()
1164 struct snd_pcm_runtime *runtime = substream->runtime; snd_cs4231_capture_open()
1174 chip->capture_substream = substream; snd_cs4231_capture_open()
1176 snd_pcm_set_sync(substream); snd_cs4231_capture_open()
1182 static int snd_cs4231_playback_close(struct snd_pcm_substream *substream) snd_cs4231_playback_close() argument
1184 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_playback_close()
1192 static int snd_cs4231_capture_close(struct snd_pcm_substream *substream) snd_cs4231_capture_close() argument
1194 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_capture_close()
422 snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, struct snd_pcm_substream *substream, unsigned int *periods_sent) snd_cs4231_advance_dma() argument
997 snd_cs4231_playback_pointer( struct snd_pcm_substream *substream) snd_cs4231_playback_pointer() argument
1013 snd_cs4231_capture_pointer( struct snd_pcm_substream *substream) snd_cs4231_capture_pointer() argument
H A Damd7930.c567 static int snd_amd7930_playback_trigger(struct snd_pcm_substream *substream, snd_amd7930_playback_trigger() argument
570 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_playback_trigger()
574 static int snd_amd7930_capture_trigger(struct snd_pcm_substream *substream, snd_amd7930_capture_trigger() argument
577 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_capture_trigger()
581 static int snd_amd7930_playback_prepare(struct snd_pcm_substream *substream) snd_amd7930_playback_prepare() argument
583 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_playback_prepare()
584 struct snd_pcm_runtime *runtime = substream->runtime; snd_amd7930_playback_prepare()
585 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_amd7930_playback_prepare()
613 static int snd_amd7930_capture_prepare(struct snd_pcm_substream *substream) snd_amd7930_capture_prepare() argument
615 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_capture_prepare()
616 struct snd_pcm_runtime *runtime = substream->runtime; snd_amd7930_capture_prepare()
617 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_amd7930_capture_prepare()
645 static snd_pcm_uframes_t snd_amd7930_playback_pointer(struct snd_pcm_substream *substream) snd_amd7930_playback_pointer() argument
647 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_playback_pointer()
653 return bytes_to_frames(substream->runtime, ptr); snd_amd7930_playback_pointer()
656 static snd_pcm_uframes_t snd_amd7930_capture_pointer(struct snd_pcm_substream *substream) snd_amd7930_capture_pointer() argument
658 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_capture_pointer()
665 return bytes_to_frames(substream->runtime, ptr); snd_amd7930_capture_pointer()
689 static int snd_amd7930_playback_open(struct snd_pcm_substream *substream) snd_amd7930_playback_open() argument
691 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_playback_open()
692 struct snd_pcm_runtime *runtime = substream->runtime; snd_amd7930_playback_open()
694 amd->playback_substream = substream; snd_amd7930_playback_open()
699 static int snd_amd7930_capture_open(struct snd_pcm_substream *substream) snd_amd7930_capture_open() argument
701 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_capture_open()
702 struct snd_pcm_runtime *runtime = substream->runtime; snd_amd7930_capture_open()
704 amd->capture_substream = substream; snd_amd7930_capture_open()
709 static int snd_amd7930_playback_close(struct snd_pcm_substream *substream) snd_amd7930_playback_close() argument
711 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_playback_close()
717 static int snd_amd7930_capture_close(struct snd_pcm_substream *substream) snd_amd7930_capture_close() argument
719 struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); snd_amd7930_capture_close()
725 static int snd_amd7930_hw_params(struct snd_pcm_substream *substream, snd_amd7930_hw_params() argument
728 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); snd_amd7930_hw_params()
731 static int snd_amd7930_hw_free(struct snd_pcm_substream *substream) snd_amd7930_hw_free() argument
733 return snd_pcm_lib_free_pages(substream); snd_amd7930_hw_free()
/linux-4.1.27/sound/soc/spear/
H A Dspdif_out.c60 static int spdif_out_startup(struct snd_pcm_substream *substream, spdif_out_startup() argument
66 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) spdif_out_startup()
79 static void spdif_out_shutdown(struct snd_pcm_substream *substream, spdif_out_shutdown() argument
84 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) spdif_out_shutdown()
105 static int spdif_out_hw_params(struct snd_pcm_substream *substream, spdif_out_hw_params() argument
112 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) spdif_out_hw_params()
151 static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd, spdif_out_trigger() argument
158 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) spdif_out_trigger()
/linux-4.1.27/sound/drivers/mpu401/
H A Dmpu401_uart.c284 static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream) snd_mpu401_uart_input_open() argument
289 mpu = substream->rmidi->private_data; snd_mpu401_uart_input_open()
296 mpu->substream_input = substream; snd_mpu401_uart_input_open()
306 static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream) snd_mpu401_uart_output_open() argument
311 mpu = substream->rmidi->private_data; snd_mpu401_uart_output_open()
318 mpu->substream_output = substream; snd_mpu401_uart_output_open()
328 static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream) snd_mpu401_uart_input_close() argument
333 mpu = substream->rmidi->private_data; snd_mpu401_uart_input_close()
345 static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream) snd_mpu401_uart_output_close() argument
350 mpu = substream->rmidi->private_data; snd_mpu401_uart_output_close()
366 snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up) snd_mpu401_uart_input_trigger() argument
372 mpu = substream->rmidi->private_data; snd_mpu401_uart_input_trigger()
453 snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up) snd_mpu401_uart_output_trigger() argument
458 mpu = substream->rmidi->private_data; snd_mpu401_uart_output_trigger()
/linux-4.1.27/sound/pci/rme9652/
H A Drme9652.c182 /* the size of a substream (1 mono data stream) */
1848 snd_pcm_period_elapsed(rme9652->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); snd_rme9652_interrupt()
1852 snd_pcm_period_elapsed(rme9652->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); snd_rme9652_interrupt()
1857 static snd_pcm_uframes_t snd_rme9652_hw_pointer(struct snd_pcm_substream *substream) snd_rme9652_hw_pointer() argument
1859 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_hw_pointer()
1886 static int snd_rme9652_playback_copy(struct snd_pcm_substream *substream, int channel, snd_rme9652_playback_copy() argument
1889 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_playback_copy()
1896 substream->pstr->stream, snd_rme9652_playback_copy()
1905 static int snd_rme9652_capture_copy(struct snd_pcm_substream *substream, int channel, snd_rme9652_capture_copy() argument
1908 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_capture_copy()
1915 substream->pstr->stream, snd_rme9652_capture_copy()
1924 static int snd_rme9652_hw_silence(struct snd_pcm_substream *substream, int channel, snd_rme9652_hw_silence() argument
1927 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_hw_silence()
1931 substream->pstr->stream, snd_rme9652_hw_silence()
1939 static int snd_rme9652_reset(struct snd_pcm_substream *substream) snd_rme9652_reset() argument
1941 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme9652_reset()
1942 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_reset()
1944 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_rme9652_reset()
1955 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
1965 static int snd_rme9652_hw_params(struct snd_pcm_substream *substream, snd_rme9652_hw_params() argument
1968 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_hw_params()
1975 if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { snd_rme9652_hw_params()
2030 static int snd_rme9652_channel_info(struct snd_pcm_substream *substream, snd_rme9652_channel_info() argument
2033 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_channel_info()
2049 static int snd_rme9652_ioctl(struct snd_pcm_substream *substream, snd_rme9652_ioctl() argument
2055 return snd_rme9652_reset(substream); snd_rme9652_ioctl()
2060 return snd_rme9652_channel_info(substream, info); snd_rme9652_ioctl()
2066 return snd_pcm_lib_ioctl(substream, cmd, arg); snd_rme9652_ioctl()
2074 static int snd_rme9652_trigger(struct snd_pcm_substream *substream, snd_rme9652_trigger() argument
2077 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_trigger()
2084 running |= 1 << substream->stream; snd_rme9652_trigger()
2087 running &= ~(1 << substream->stream); snd_rme9652_trigger()
2094 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_rme9652_trigger()
2101 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
2103 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
2113 substream->stream == SNDRV_PCM_STREAM_CAPTURE)
2117 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
2121 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
2125 snd_pcm_trigger_done(substream, substream);
2136 static int snd_rme9652_prepare(struct snd_pcm_substream *substream) snd_rme9652_prepare() argument
2138 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_prepare()
2261 static int snd_rme9652_playback_open(struct snd_pcm_substream *substream) snd_rme9652_playback_open() argument
2263 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_playback_open()
2264 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme9652_playback_open()
2268 snd_pcm_set_sync(substream); snd_rme9652_playback_open()
2280 rme9652->playback_substream = substream; snd_rme9652_playback_open()
2303 static int snd_rme9652_playback_release(struct snd_pcm_substream *substream) snd_rme9652_playback_release() argument
2305 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_playback_release()
2321 static int snd_rme9652_capture_open(struct snd_pcm_substream *substream) snd_rme9652_capture_open() argument
2323 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_capture_open()
2324 struct snd_pcm_runtime *runtime = substream->runtime; snd_rme9652_capture_open()
2328 snd_pcm_set_sync(substream); snd_rme9652_capture_open()
2340 rme9652->capture_substream = substream; snd_rme9652_capture_open()
2358 static int snd_rme9652_capture_release(struct snd_pcm_substream *substream) snd_rme9652_capture_release() argument
2360 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); snd_rme9652_capture_release()
/linux-4.1.27/sound/usb/usx2y/
H A Dusx2yhwdeppcm.c273 * release a substream
310 * initialize a substream's urbs
356 static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream) snd_usX2Y_usbpcm_hw_free() argument
358 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_hw_free()
362 snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); snd_usX2Y_usbpcm_hw_free()
364 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { snd_usX2Y_usbpcm_hw_free()
391 return snd_pcm_lib_free_pages(substream); snd_usX2Y_usbpcm_hw_free()
481 static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) snd_usX2Y_usbpcm_prepare() argument
483 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_prepare()
488 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); snd_usX2Y_usbpcm_prepare()
562 static int snd_usX2Y_usbpcm_open(struct snd_pcm_substream *substream) snd_usX2Y_usbpcm_open() argument
565 snd_pcm_substream_chip(substream))[substream->stream]; snd_usX2Y_usbpcm_open()
566 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_open()
571 runtime->hw = SNDRV_PCM_STREAM_PLAYBACK == substream->stream ? snd_usX2Y_2c : snd_usX2Y_usbpcm_open()
574 subs->pcm_substream = substream; snd_usX2Y_usbpcm_open()
580 static int snd_usX2Y_usbpcm_close(struct snd_pcm_substream *substream) snd_usX2Y_usbpcm_close() argument
582 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_usbpcm_close()
740 if (0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream, usX2Y_hwdep_pcm_new()
744 0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, usX2Y_hwdep_pcm_new()
H A Dusbusx2yaudio.c405 * initialize a substream's urbs
523 static snd_pcm_uframes_t snd_usX2Y_pcm_pointer(struct snd_pcm_substream *substream) snd_usX2Y_pcm_pointer() argument
525 struct snd_usX2Y_substream *subs = substream->runtime->private_data; snd_usX2Y_pcm_pointer()
529 * start/stop substream
531 static int snd_usX2Y_pcm_trigger(struct snd_pcm_substream *substream, int cmd) snd_usX2Y_pcm_trigger() argument
533 struct snd_usX2Y_substream *subs = substream->runtime->private_data; snd_usX2Y_pcm_trigger()
743 static int snd_usX2Y_pcm_hw_params(struct snd_pcm_substream *substream, snd_usX2Y_pcm_hw_params() argument
749 struct snd_card *card = substream->pstr->pcm->card; snd_usX2Y_pcm_hw_params()
754 snd_printdd("snd_usX2Y_hw_params(%p, %p)\n", substream, hw_params); snd_usX2Y_pcm_hw_params()
765 if (!test_substream || test_substream == substream || snd_usX2Y_pcm_hw_params()
777 err = snd_pcm_lib_malloc_pages(substream, snd_usX2Y_pcm_hw_params()
781 substream, params_buffer_bytes(hw_params), err); snd_usX2Y_pcm_hw_params()
793 static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream) snd_usX2Y_pcm_hw_free() argument
795 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_hw_free()
798 snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); snd_usX2Y_pcm_hw_free()
800 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { snd_usX2Y_pcm_hw_free()
819 return snd_pcm_lib_free_pages(substream); snd_usX2Y_pcm_hw_free()
826 static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) snd_usX2Y_pcm_prepare() argument
828 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_prepare()
833 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); snd_usX2Y_pcm_prepare()
881 static int snd_usX2Y_pcm_open(struct snd_pcm_substream *substream) snd_usX2Y_pcm_open() argument
884 snd_pcm_substream_chip(substream))[substream->stream]; snd_usX2Y_pcm_open()
885 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_open()
892 subs->pcm_substream = substream; snd_usX2Y_pcm_open()
899 static int snd_usX2Y_pcm_close(struct snd_pcm_substream *substream) snd_usX2Y_pcm_close() argument
901 struct snd_pcm_runtime *runtime = substream->runtime; snd_usX2Y_pcm_close()
982 0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream, usX2Y_audio_stream_new()
986 0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, usX2Y_audio_stream_new()
/linux-4.1.27/sound/aoa/soundbus/
H A Dsoundbus.h107 struct snd_pcm_substream *substream);
112 struct snd_pcm_substream *substream);
115 * they are not valid with the substream/transfer info,
118 * If the selected stuff in the substream is NOT
122 struct snd_pcm_substream *substream);
127 struct snd_pcm_substream *substream);
132 struct snd_pcm_substream *substream);
/linux-4.1.27/sound/soc/codecs/
H A Dac97.c36 static int ac97_prepare(struct snd_pcm_substream *substream, ac97_prepare() argument
42 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? ac97_prepare()
44 return snd_ac97_set_rate(ac97, reg, substream->runtime->rate); ac97_prepare()
/linux-4.1.27/sound/pci/riptide/
H A Driptide.c426 #define get_pcmhwdev(substream) (struct pcmhw *)(substream->runtime->private_data)
1091 struct snd_pcm_substream *substream[PLAYBACK_SUBSTREAMS + 1]; riptide_handleirq() local
1103 substream[i] = chip->playback_substream[i]; riptide_handleirq()
1104 substream[i] = chip->capture_substream; riptide_handleirq()
1106 if (substream[i] && riptide_handleirq()
1107 (runtime = substream[i]->runtime) && riptide_handleirq()
1147 snd_pcm_period_elapsed(substream[i]); riptide_handleirq()
1358 *substream) snd_riptide_pointer()
1360 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_pointer()
1361 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_pointer()
1362 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_pointer()
1391 static int snd_riptide_trigger(struct snd_pcm_substream *substream, int cmd) snd_riptide_trigger() argument
1394 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_trigger()
1395 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_trigger()
1453 static int snd_riptide_prepare(struct snd_pcm_substream *substream) snd_riptide_prepare() argument
1455 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_prepare()
1456 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_prepare()
1457 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_prepare()
1517 addr = snd_pcm_sgbuf_get_addr(substream, ofs) + pt; snd_riptide_prepare()
1554 snd_riptide_hw_params(struct snd_pcm_substream *substream, snd_riptide_hw_params() argument
1557 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_hw_params()
1558 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_hw_params()
1576 return snd_pcm_lib_malloc_pages(substream, snd_riptide_hw_params()
1580 static int snd_riptide_hw_free(struct snd_pcm_substream *substream) snd_riptide_hw_free() argument
1582 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_hw_free()
1583 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_hw_free()
1599 return snd_pcm_lib_free_pages(substream); snd_riptide_hw_free()
1602 static int snd_riptide_playback_open(struct snd_pcm_substream *substream) snd_riptide_playback_open() argument
1604 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_playback_open()
1605 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_playback_open()
1607 int sub_num = substream->number; snd_riptide_playback_open()
1609 chip->playback_substream[sub_num] = substream; snd_riptide_playback_open()
1626 static int snd_riptide_capture_open(struct snd_pcm_substream *substream) snd_riptide_capture_open() argument
1628 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_capture_open()
1629 struct snd_pcm_runtime *runtime = substream->runtime; snd_riptide_capture_open()
1632 chip->capture_substream = substream; snd_riptide_capture_open()
1649 static int snd_riptide_playback_close(struct snd_pcm_substream *substream) snd_riptide_playback_close() argument
1651 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_playback_close()
1652 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_playback_close()
1653 int sub_num = substream->number; snd_riptide_playback_close()
1655 substream->runtime->private_data = NULL; snd_riptide_playback_close()
1661 static int snd_riptide_capture_close(struct snd_pcm_substream *substream) snd_riptide_capture_close() argument
1663 struct snd_riptide *chip = snd_pcm_substream_chip(substream); snd_riptide_capture_close()
1664 struct pcmhw *data = get_pcmhwdev(substream); snd_riptide_capture_close()
1666 substream->runtime->private_data = NULL; snd_riptide_capture_close()
1357 snd_riptide_pointer(struct snd_pcm_substream *substream) snd_riptide_pointer() argument
/linux-4.1.27/sound/isa/wss/
H A Dwss_lib.c480 static int snd_wss_trigger(struct snd_pcm_substream *substream, snd_wss_trigger() argument
483 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_trigger()
501 snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry()
504 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
507 snd_pcm_trigger_done(s, substream); snd_pcm_group_for_each_entry()
994 static int snd_wss_playback_hw_params(struct snd_pcm_substream *substream, snd_wss_playback_hw_params() argument
997 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_playback_hw_params()
1001 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_wss_playback_hw_params()
1010 static int snd_wss_playback_hw_free(struct snd_pcm_substream *substream) snd_wss_playback_hw_free() argument
1012 return snd_pcm_lib_free_pages(substream); snd_wss_playback_hw_free()
1015 static int snd_wss_playback_prepare(struct snd_pcm_substream *substream) snd_wss_playback_prepare() argument
1017 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_playback_prepare()
1018 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_playback_prepare()
1020 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_wss_playback_prepare()
1021 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_wss_playback_prepare()
1037 static int snd_wss_capture_hw_params(struct snd_pcm_substream *substream, snd_wss_capture_hw_params() argument
1040 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_capture_hw_params()
1044 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) snd_wss_capture_hw_params()
1053 static int snd_wss_capture_hw_free(struct snd_pcm_substream *substream) snd_wss_capture_hw_free() argument
1055 return snd_pcm_lib_free_pages(substream); snd_wss_capture_hw_free()
1058 static int snd_wss_capture_prepare(struct snd_pcm_substream *substream) snd_wss_capture_prepare() argument
1060 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_capture_prepare()
1061 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_capture_prepare()
1063 unsigned int size = snd_pcm_lib_buffer_bytes(substream); snd_wss_capture_prepare()
1064 unsigned int count = snd_pcm_lib_period_bytes(substream); snd_wss_capture_prepare()
1154 static snd_pcm_uframes_t snd_wss_playback_pointer(struct snd_pcm_substream *substream) snd_wss_playback_pointer() argument
1156 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_playback_pointer()
1162 return bytes_to_frames(substream->runtime, ptr); snd_wss_playback_pointer()
1165 static snd_pcm_uframes_t snd_wss_capture_pointer(struct snd_pcm_substream *substream) snd_wss_capture_pointer() argument
1167 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_capture_pointer()
1173 return bytes_to_frames(substream->runtime, ptr); snd_wss_capture_pointer()
1500 static int snd_wss_playback_open(struct snd_pcm_substream *substream) snd_wss_playback_open() argument
1502 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_playback_open()
1503 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_playback_open()
1537 chip->playback_substream = substream; snd_wss_playback_open()
1538 snd_pcm_set_sync(substream); snd_wss_playback_open()
1543 static int snd_wss_capture_open(struct snd_pcm_substream *substream) snd_wss_capture_open() argument
1545 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_capture_open()
1546 struct snd_pcm_runtime *runtime = substream->runtime; snd_wss_capture_open()
1578 chip->capture_substream = substream; snd_wss_capture_open()
1579 snd_pcm_set_sync(substream); snd_wss_capture_open()
1584 static int snd_wss_playback_close(struct snd_pcm_substream *substream) snd_wss_playback_close() argument
1586 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_playback_close()
1593 static int snd_wss_capture_close(struct snd_pcm_substream *substream) snd_wss_capture_close() argument
1595 struct snd_wss *chip = snd_pcm_substream_chip(substream); snd_wss_capture_close()
/linux-4.1.27/sound/soc/intel/boards/
H A Dbytcr_rt5640.c67 static int byt_aif1_hw_params(struct snd_pcm_substream *substream, byt_aif1_hw_params() argument
70 struct snd_soc_pcm_runtime *rtd = substream->private_data; byt_aif1_hw_params()
129 static int byt_aif1_startup(struct snd_pcm_substream *substream) byt_aif1_startup() argument
131 return snd_pcm_hw_constraint_list(substream->runtime, 0, byt_aif1_startup()

Completed in 6633 milliseconds

123