Searched refs:gosnd (Results 1 - 1 of 1) sorted by relevance
/linux-4.1.27/drivers/media/usb/go7007/ |
H A D | snd-go7007.c | 75 struct go7007_snd *gosnd = go->snd_context; parse_audio_stream_data() local 76 struct snd_pcm_runtime *runtime = gosnd->substream->runtime; parse_audio_stream_data() 79 spin_lock(&gosnd->lock); parse_audio_stream_data() 80 gosnd->hw_ptr += frames; parse_audio_stream_data() 81 if (gosnd->hw_ptr >= runtime->buffer_size) parse_audio_stream_data() 82 gosnd->hw_ptr -= runtime->buffer_size; parse_audio_stream_data() 83 gosnd->avail += frames; parse_audio_stream_data() 84 spin_unlock(&gosnd->lock); parse_audio_stream_data() 85 if (gosnd->w_idx + length > runtime->dma_bytes) { parse_audio_stream_data() 86 int cpy = runtime->dma_bytes - gosnd->w_idx; parse_audio_stream_data() 88 memcpy(runtime->dma_area + gosnd->w_idx, buf, cpy); parse_audio_stream_data() 91 gosnd->w_idx = 0; parse_audio_stream_data() 93 memcpy(runtime->dma_area + gosnd->w_idx, buf, length); parse_audio_stream_data() 94 gosnd->w_idx += length; parse_audio_stream_data() 95 spin_lock(&gosnd->lock); parse_audio_stream_data() 96 if (gosnd->avail < runtime->period_size) { parse_audio_stream_data() 97 spin_unlock(&gosnd->lock); parse_audio_stream_data() 100 gosnd->avail -= runtime->period_size; parse_audio_stream_data() 101 spin_unlock(&gosnd->lock); parse_audio_stream_data() 102 if (gosnd->capturing) parse_audio_stream_data() 103 snd_pcm_period_elapsed(gosnd->substream); parse_audio_stream_data() 138 struct go7007_snd *gosnd = go->snd_context; go7007_snd_capture_open() local 142 spin_lock_irqsave(&gosnd->lock, flags); go7007_snd_capture_open() 143 if (gosnd->substream == NULL) { go7007_snd_capture_open() 144 gosnd->substream = substream; go7007_snd_capture_open() 149 spin_unlock_irqrestore(&gosnd->lock, flags); go7007_snd_capture_open() 156 struct go7007_snd *gosnd = go->snd_context; go7007_snd_capture_close() local 158 gosnd->substream = NULL; go7007_snd_capture_close() 170 struct go7007_snd *gosnd = go->snd_context; go7007_snd_pcm_trigger() local 176 gosnd->capturing = 1; go7007_snd_pcm_trigger() 179 gosnd->hw_ptr = gosnd->w_idx = gosnd->avail = 0; go7007_snd_pcm_trigger() 180 gosnd->capturing = 0; go7007_snd_pcm_trigger() 190 struct go7007_snd *gosnd = go->snd_context; go7007_snd_pcm_pointer() local 192 return gosnd->hw_ptr; go7007_snd_pcm_pointer() 229 struct go7007_snd *gosnd; go7007_snd_init() local 238 gosnd = kmalloc(sizeof(struct go7007_snd), GFP_KERNEL); go7007_snd_init() 239 if (gosnd == NULL) go7007_snd_init() 241 spin_lock_init(&gosnd->lock); go7007_snd_init() 242 gosnd->hw_ptr = gosnd->w_idx = gosnd->avail = 0; go7007_snd_init() 243 gosnd->capturing = 0; go7007_snd_init() 245 &gosnd->card); go7007_snd_init() 247 kfree(gosnd); go7007_snd_init() 250 ret = snd_device_new(gosnd->card, SNDRV_DEV_LOWLEVEL, go, go7007_snd_init() 253 kfree(gosnd); go7007_snd_init() 256 ret = snd_pcm_new(gosnd->card, "go7007", 0, 0, 1, &gosnd->pcm); go7007_snd_init() 258 snd_card_free(gosnd->card); go7007_snd_init() 259 kfree(gosnd); go7007_snd_init() 262 strlcpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); go7007_snd_init() 263 strlcpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); go7007_snd_init() 264 strlcpy(gosnd->card->longname, gosnd->card->shortname, go7007_snd_init() 265 sizeof(gosnd->card->longname)); go7007_snd_init() 267 gosnd->pcm->private_data = go; go7007_snd_init() 268 snd_pcm_set_ops(gosnd->pcm, SNDRV_PCM_STREAM_CAPTURE, go7007_snd_init() 271 ret = snd_card_register(gosnd->card); go7007_snd_init() 273 snd_card_free(gosnd->card); go7007_snd_init() 274 kfree(gosnd); go7007_snd_init() 278 gosnd->substream = NULL; go7007_snd_init() 279 go->snd_context = gosnd; go7007_snd_init() 289 struct go7007_snd *gosnd = go->snd_context; go7007_snd_remove() local 291 snd_card_disconnect(gosnd->card); go7007_snd_remove() 292 snd_card_free_when_closed(gosnd->card); go7007_snd_remove()
|
Completed in 74 milliseconds