Lines Matching defs:sub
255 static bool hiface_pcm_playback(struct pcm_substream *sub, struct pcm_urb *urb)
257 struct snd_pcm_runtime *alsa_rt = sub->instance->runtime;
264 pcm_buffer_size = snd_pcm_lib_buffer_bytes(sub->instance);
266 if (sub->dma_off + PCM_PACKET_SIZE <= pcm_buffer_size) {
269 (unsigned int) sub->dma_off);
271 source = alsa_rt->dma_area + sub->dma_off;
279 (unsigned int) sub->dma_off);
281 len = pcm_buffer_size - sub->dma_off;
283 source = alsa_rt->dma_area + sub->dma_off;
290 sub->dma_off += PCM_PACKET_SIZE;
291 if (sub->dma_off >= pcm_buffer_size)
292 sub->dma_off -= pcm_buffer_size;
294 sub->period_off += PCM_PACKET_SIZE;
295 if (sub->period_off >= alsa_rt->period_size) {
296 sub->period_off %= alsa_rt->period_size;
306 struct pcm_substream *sub;
326 sub = &rt->playback;
327 scoped_guard(spinlock_irqsave, &sub->lock) {
328 if (sub->active)
329 do_period_elapsed = hiface_pcm_playback(sub, out_urb);
335 snd_pcm_period_elapsed(sub->instance);
350 struct pcm_substream *sub = NULL;
361 sub = &rt->playback;
363 if (!sub) {
381 sub->instance = alsa_sub;
382 sub->active = false;
389 struct pcm_substream *sub = hiface_pcm_get_substream(alsa_sub);
395 if (sub) {
399 guard(spinlock_irqsave)(&sub->lock);
400 sub->instance = NULL;
401 sub->active = false;
409 struct pcm_substream *sub = hiface_pcm_get_substream(alsa_sub);
415 if (!sub)
422 sub->dma_off = 0;
423 sub->period_off = 0;
439 struct pcm_substream *sub = hiface_pcm_get_substream(alsa_sub);
444 if (!sub)
450 scoped_guard(spinlock_irq, &sub->lock) {
451 sub->active = true;
457 scoped_guard(spinlock_irq, &sub->lock) {
458 sub->active = false;
469 struct pcm_substream *sub = hiface_pcm_get_substream(alsa_sub);
473 if (rt->panic || !sub)
476 guard(spinlock_irqsave)(&sub->lock);
477 dma_offset = sub->dma_off;