diff options
Diffstat (limited to 'drivers/media/video/tm6000/tm6000-alsa.c')
-rw-r--r-- | drivers/media/video/tm6000/tm6000-alsa.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/media/video/tm6000/tm6000-alsa.c b/drivers/media/video/tm6000/tm6000-alsa.c index bb2047c10358..bd07ec707956 100644 --- a/drivers/media/video/tm6000/tm6000-alsa.c +++ b/drivers/media/video/tm6000/tm6000-alsa.c | |||
@@ -146,20 +146,21 @@ static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size) | |||
146 | #define DEFAULT_FIFO_SIZE 4096 | 146 | #define DEFAULT_FIFO_SIZE 4096 |
147 | 147 | ||
148 | static struct snd_pcm_hardware snd_tm6000_digital_hw = { | 148 | static struct snd_pcm_hardware snd_tm6000_digital_hw = { |
149 | .info = SNDRV_PCM_INFO_MMAP | | 149 | .info = SNDRV_PCM_INFO_BATCH | |
150 | SNDRV_PCM_INFO_MMAP | | ||
150 | SNDRV_PCM_INFO_INTERLEAVED | | 151 | SNDRV_PCM_INFO_INTERLEAVED | |
151 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 152 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
152 | SNDRV_PCM_INFO_MMAP_VALID, | 153 | SNDRV_PCM_INFO_MMAP_VALID, |
153 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 154 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
154 | 155 | ||
155 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | 156 | .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT, |
156 | .rate_min = 48000, | 157 | .rate_min = 48000, |
157 | .rate_max = 48000, | 158 | .rate_max = 48000, |
158 | .channels_min = 2, | 159 | .channels_min = 2, |
159 | .channels_max = 2, | 160 | .channels_max = 2, |
160 | .period_bytes_min = 64, | 161 | .period_bytes_min = 64, |
161 | .period_bytes_max = 12544, | 162 | .period_bytes_max = 12544, |
162 | .periods_min = 1, | 163 | .periods_min = 2, |
163 | .periods_max = 98, | 164 | .periods_max = 98, |
164 | .buffer_bytes_max = 62720 * 8, | 165 | .buffer_bytes_max = 62720 * 8, |
165 | }; | 166 | }; |
@@ -181,6 +182,7 @@ static int snd_tm6000_pcm_open(struct snd_pcm_substream *substream) | |||
181 | chip->substream = substream; | 182 | chip->substream = substream; |
182 | 183 | ||
183 | runtime->hw = snd_tm6000_digital_hw; | 184 | runtime->hw = snd_tm6000_digital_hw; |
185 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); | ||
184 | 186 | ||
185 | return 0; | 187 | return 0; |
186 | _error: | 188 | _error: |
@@ -347,9 +349,13 @@ static int snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int cmd) | |||
347 | int err = 0; | 349 | int err = 0; |
348 | 350 | ||
349 | switch (cmd) { | 351 | switch (cmd) { |
352 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */ | ||
353 | case SNDRV_PCM_TRIGGER_RESUME: /* fall through */ | ||
350 | case SNDRV_PCM_TRIGGER_START: | 354 | case SNDRV_PCM_TRIGGER_START: |
351 | atomic_set(&core->stream_started, 1); | 355 | atomic_set(&core->stream_started, 1); |
352 | break; | 356 | break; |
357 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */ | ||
358 | case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */ | ||
353 | case SNDRV_PCM_TRIGGER_STOP: | 359 | case SNDRV_PCM_TRIGGER_STOP: |
354 | atomic_set(&core->stream_started, 0); | 360 | atomic_set(&core->stream_started, 0); |
355 | break; | 361 | break; |
@@ -371,6 +377,14 @@ static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream) | |||
371 | return chip->buf_pos; | 377 | return chip->buf_pos; |
372 | } | 378 | } |
373 | 379 | ||
380 | static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, | ||
381 | unsigned long offset) | ||
382 | { | ||
383 | void *pageptr = subs->runtime->dma_area + offset; | ||
384 | |||
385 | return vmalloc_to_page(pageptr); | ||
386 | } | ||
387 | |||
374 | /* | 388 | /* |
375 | * operators | 389 | * operators |
376 | */ | 390 | */ |
@@ -383,6 +397,7 @@ static struct snd_pcm_ops snd_tm6000_pcm_ops = { | |||
383 | .prepare = snd_tm6000_prepare, | 397 | .prepare = snd_tm6000_prepare, |
384 | .trigger = snd_tm6000_card_trigger, | 398 | .trigger = snd_tm6000_card_trigger, |
385 | .pointer = snd_tm6000_pointer, | 399 | .pointer = snd_tm6000_pointer, |
400 | .page = snd_pcm_get_vmalloc_page, | ||
386 | }; | 401 | }; |
387 | 402 | ||
388 | /* | 403 | /* |