18 #include <linux/kernel.h>
19 #include <linux/module.h>
24 #include <linux/sched.h>
26 #include <linux/time.h>
28 #include <linux/i2c.h>
31 #include <linux/slab.h>
72 .period_bytes_min = 4096,
73 .period_bytes_max = (128*1024),
82 int frames = bytes_to_frames(runtime, length);
84 spin_lock(&gosnd->
lock);
88 gosnd->
avail += frames;
89 spin_unlock(&gosnd->
lock);
100 spin_lock(&gosnd->
lock);
102 spin_unlock(&gosnd->
lock);
106 spin_unlock(&gosnd->
lock);
118 if (substream->
runtime->dma_bytes > 0)
120 substream->
runtime->dma_bytes = 0;
134 if (substream->
runtime->dma_bytes > 0)
136 substream->
runtime->dma_bytes = 0;
150 substream->
runtime->hw = go7007_snd_capture_hw;
154 spin_unlock_irqrestore(&gosnd->
lock, flags);
206 static struct snd_pcm_ops go7007_snd_capture_ops = {
207 .open = go7007_snd_capture_open,
208 .close = go7007_snd_capture_close,
210 .hw_params = go7007_snd_hw_params,
211 .hw_free = go7007_snd_hw_free,
212 .prepare = go7007_snd_pcm_prepare,
213 .trigger = go7007_snd_pcm_trigger,
214 .pointer = go7007_snd_pcm_pointer,
215 .page = go7007_snd_pcm_page,
230 .dev_free = go7007_snd_free,
258 &go7007_snd_device_ops);
273 sizeof(gosnd->
card->longname));
275 gosnd->
pcm->private_data =
go;
277 &go7007_snd_capture_ops);