aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c')
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
index d54033ebd5e9..09cb250d5827 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36/* get the physical page pointer on the given offset */ 36/* get the physical page pointer on the given offset */
37static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset) 37static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, unsigned long offset)
38{ 38{
39 void *pageptr = subs->runtime->dma_area + offset; 39 void *pageptr = subs->runtime->dma_area + offset;
40 return vmalloc_to_page(pageptr); 40 return vmalloc_to_page(pageptr);
@@ -44,9 +44,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned
44 * hw_params callback 44 * hw_params callback
45 * NOTE: this may be called not only once per pcm open! 45 * NOTE: this may be called not only once per pcm open!
46 */ 46 */
47static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) 47static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size)
48{ 48{
49 snd_pcm_runtime_t *runtime = subs->runtime; 49 struct snd_pcm_runtime *runtime = subs->runtime;
50 if (runtime->dma_area) { 50 if (runtime->dma_area) {
51 if (runtime->dma_bytes >= size) 51 if (runtime->dma_bytes >= size)
52 return 0; /* already enough large */ 52 return 0; /* already enough large */
@@ -63,9 +63,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size)
63 * hw_free callback 63 * hw_free callback
64 * NOTE: this may be called not only once per pcm open! 64 * NOTE: this may be called not only once per pcm open!
65 */ 65 */
66static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) 66static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
67{ 67{
68 snd_pcm_runtime_t *runtime = subs->runtime; 68 struct snd_pcm_runtime *runtime = subs->runtime;
69 if (runtime->dma_area) { 69 if (runtime->dma_area) {
70 vfree(runtime->dma_area); 70 vfree(runtime->dma_area);
71 runtime->dma_area = NULL; 71 runtime->dma_area = NULL;
@@ -76,7 +76,7 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs)
76/* 76/*
77 * clear the SRAM contents 77 * clear the SRAM contents
78 */ 78 */
79static int pdacf_pcm_clear_sram(pdacf_t *chip) 79static int pdacf_pcm_clear_sram(struct snd_pdacf *chip)
80{ 80{
81 int max_loop = 64 * 1024; 81 int max_loop = 64 * 1024;
82 82
@@ -91,10 +91,10 @@ static int pdacf_pcm_clear_sram(pdacf_t *chip)
91/* 91/*
92 * pdacf_pcm_trigger - trigger callback for capture 92 * pdacf_pcm_trigger - trigger callback for capture
93 */ 93 */
94static int pdacf_pcm_trigger(snd_pcm_substream_t *subs, int cmd) 94static int pdacf_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
95{ 95{
96 pdacf_t *chip = snd_pcm_substream_chip(subs); 96 struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
97 snd_pcm_runtime_t *runtime = subs->runtime; 97 struct snd_pcm_runtime *runtime = subs->runtime;
98 int inc, ret = 0, rate; 98 int inc, ret = 0, rate;
99 unsigned short mask, val, tmp; 99 unsigned short mask, val, tmp;
100 100
@@ -146,8 +146,8 @@ static int pdacf_pcm_trigger(snd_pcm_substream_t *subs, int cmd)
146/* 146/*
147 * pdacf_pcm_hw_params - hw_params callback for playback and capture 147 * pdacf_pcm_hw_params - hw_params callback for playback and capture
148 */ 148 */
149static int pdacf_pcm_hw_params(snd_pcm_substream_t *subs, 149static int pdacf_pcm_hw_params(struct snd_pcm_substream *subs,
150 snd_pcm_hw_params_t *hw_params) 150 struct snd_pcm_hw_params *hw_params)
151{ 151{
152 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params)); 152 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params));
153} 153}
@@ -155,7 +155,7 @@ static int pdacf_pcm_hw_params(snd_pcm_substream_t *subs,
155/* 155/*
156 * pdacf_pcm_hw_free - hw_free callback for playback and capture 156 * pdacf_pcm_hw_free - hw_free callback for playback and capture
157 */ 157 */
158static int pdacf_pcm_hw_free(snd_pcm_substream_t *subs) 158static int pdacf_pcm_hw_free(struct snd_pcm_substream *subs)
159{ 159{
160 return snd_pcm_free_vmalloc_buffer(subs); 160 return snd_pcm_free_vmalloc_buffer(subs);
161} 161}
@@ -163,10 +163,10 @@ static int pdacf_pcm_hw_free(snd_pcm_substream_t *subs)
163/* 163/*
164 * pdacf_pcm_prepare - prepare callback for playback and capture 164 * pdacf_pcm_prepare - prepare callback for playback and capture
165 */ 165 */
166static int pdacf_pcm_prepare(snd_pcm_substream_t *subs) 166static int pdacf_pcm_prepare(struct snd_pcm_substream *subs)
167{ 167{
168 pdacf_t *chip = snd_pcm_substream_chip(subs); 168 struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
169 snd_pcm_runtime_t *runtime = subs->runtime; 169 struct snd_pcm_runtime *runtime = subs->runtime;
170 u16 val, nval, aval; 170 u16 val, nval, aval;
171 171
172 if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) 172 if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE)
@@ -239,7 +239,7 @@ static int pdacf_pcm_prepare(snd_pcm_substream_t *subs)
239 * capture hw information 239 * capture hw information
240 */ 240 */
241 241
242static snd_pcm_hardware_t pdacf_pcm_capture_hw = { 242static struct snd_pcm_hardware pdacf_pcm_capture_hw = {
243 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 243 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
244 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | 244 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
245 SNDRV_PCM_INFO_MMAP_VALID), 245 SNDRV_PCM_INFO_MMAP_VALID),
@@ -269,10 +269,10 @@ static snd_pcm_hardware_t pdacf_pcm_capture_hw = {
269/* 269/*
270 * pdacf_pcm_capture_open - open callback for capture 270 * pdacf_pcm_capture_open - open callback for capture
271 */ 271 */
272static int pdacf_pcm_capture_open(snd_pcm_substream_t *subs) 272static int pdacf_pcm_capture_open(struct snd_pcm_substream *subs)
273{ 273{
274 snd_pcm_runtime_t *runtime = subs->runtime; 274 struct snd_pcm_runtime *runtime = subs->runtime;
275 pdacf_t *chip = snd_pcm_substream_chip(subs); 275 struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
276 276
277 if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) 277 if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE)
278 return -EBUSY; 278 return -EBUSY;
@@ -287,9 +287,9 @@ static int pdacf_pcm_capture_open(snd_pcm_substream_t *subs)
287/* 287/*
288 * pdacf_pcm_capture_close - close callback for capture 288 * pdacf_pcm_capture_close - close callback for capture
289 */ 289 */
290static int pdacf_pcm_capture_close(snd_pcm_substream_t *subs) 290static int pdacf_pcm_capture_close(struct snd_pcm_substream *subs)
291{ 291{
292 pdacf_t *chip = snd_pcm_substream_chip(subs); 292 struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
293 293
294 if (!chip) 294 if (!chip)
295 return -EINVAL; 295 return -EINVAL;
@@ -302,16 +302,16 @@ static int pdacf_pcm_capture_close(snd_pcm_substream_t *subs)
302/* 302/*
303 * pdacf_pcm_capture_pointer - pointer callback for capture 303 * pdacf_pcm_capture_pointer - pointer callback for capture
304 */ 304 */
305static snd_pcm_uframes_t pdacf_pcm_capture_pointer(snd_pcm_substream_t *subs) 305static snd_pcm_uframes_t pdacf_pcm_capture_pointer(struct snd_pcm_substream *subs)
306{ 306{
307 pdacf_t *chip = snd_pcm_substream_chip(subs); 307 struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
308 return chip->pcm_hwptr; 308 return chip->pcm_hwptr;
309} 309}
310 310
311/* 311/*
312 * operators for PCM capture 312 * operators for PCM capture
313 */ 313 */
314static snd_pcm_ops_t pdacf_pcm_capture_ops = { 314static struct snd_pcm_ops pdacf_pcm_capture_ops = {
315 .open = pdacf_pcm_capture_open, 315 .open = pdacf_pcm_capture_open,
316 .close = pdacf_pcm_capture_close, 316 .close = pdacf_pcm_capture_close,
317 .ioctl = snd_pcm_lib_ioctl, 317 .ioctl = snd_pcm_lib_ioctl,
@@ -327,9 +327,9 @@ static snd_pcm_ops_t pdacf_pcm_capture_ops = {
327/* 327/*
328 * snd_pdacf_pcm_new - create and initialize a pcm 328 * snd_pdacf_pcm_new - create and initialize a pcm
329 */ 329 */
330int snd_pdacf_pcm_new(pdacf_t *chip) 330int snd_pdacf_pcm_new(struct snd_pdacf *chip)
331{ 331{
332 snd_pcm_t *pcm; 332 struct snd_pcm *pcm;
333 int err; 333 int err;
334 334
335 err = snd_pcm_new(chip->card, "PDAudioCF", 0, 0, 1, &pcm); 335 err = snd_pcm_new(chip->card, "PDAudioCF", 0, 0, 1, &pcm);