aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctpcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ctxfi/ctpcm.c')
-rw-r--r--sound/pci/ctxfi/ctpcm.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index a64cb0ed8759..52ddf19d83bb 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -26,12 +26,10 @@ static struct snd_pcm_hardware ct_pcm_playback_hw = {
26 SNDRV_PCM_INFO_MMAP_VALID | 26 SNDRV_PCM_INFO_MMAP_VALID |
27 SNDRV_PCM_INFO_PAUSE), 27 SNDRV_PCM_INFO_PAUSE),
28 .formats = (SNDRV_PCM_FMTBIT_U8 | 28 .formats = (SNDRV_PCM_FMTBIT_U8 |
29 SNDRV_PCM_FMTBIT_S8 |
30 SNDRV_PCM_FMTBIT_S16_LE | 29 SNDRV_PCM_FMTBIT_S16_LE |
31 SNDRV_PCM_FMTBIT_U16_LE |
32 SNDRV_PCM_FMTBIT_S24_3LE | 30 SNDRV_PCM_FMTBIT_S24_3LE |
33 SNDRV_PCM_FMTBIT_S24_LE | 31 SNDRV_PCM_FMTBIT_S32_LE |
34 SNDRV_PCM_FMTBIT_S32_LE), 32 SNDRV_PCM_FMTBIT_FLOAT_LE),
35 .rates = (SNDRV_PCM_RATE_CONTINUOUS | 33 .rates = (SNDRV_PCM_RATE_CONTINUOUS |
36 SNDRV_PCM_RATE_8000_192000), 34 SNDRV_PCM_RATE_8000_192000),
37 .rate_min = 8000, 35 .rate_min = 8000,
@@ -52,8 +50,7 @@ static struct snd_pcm_hardware ct_spdif_passthru_playback_hw = {
52 SNDRV_PCM_INFO_BLOCK_TRANSFER | 50 SNDRV_PCM_INFO_BLOCK_TRANSFER |
53 SNDRV_PCM_INFO_MMAP_VALID | 51 SNDRV_PCM_INFO_MMAP_VALID |
54 SNDRV_PCM_INFO_PAUSE), 52 SNDRV_PCM_INFO_PAUSE),
55 .formats = (SNDRV_PCM_FMTBIT_S16_LE | 53 .formats = SNDRV_PCM_FMTBIT_S16_LE,
56 SNDRV_PCM_FMTBIT_U16_LE),
57 .rates = (SNDRV_PCM_RATE_48000 | 54 .rates = (SNDRV_PCM_RATE_48000 |
58 SNDRV_PCM_RATE_44100 | 55 SNDRV_PCM_RATE_44100 |
59 SNDRV_PCM_RATE_32000), 56 SNDRV_PCM_RATE_32000),
@@ -77,12 +74,10 @@ static struct snd_pcm_hardware ct_pcm_capture_hw = {
77 SNDRV_PCM_INFO_PAUSE | 74 SNDRV_PCM_INFO_PAUSE |
78 SNDRV_PCM_INFO_MMAP_VALID), 75 SNDRV_PCM_INFO_MMAP_VALID),
79 .formats = (SNDRV_PCM_FMTBIT_U8 | 76 .formats = (SNDRV_PCM_FMTBIT_U8 |
80 SNDRV_PCM_FMTBIT_S8 |
81 SNDRV_PCM_FMTBIT_S16_LE | 77 SNDRV_PCM_FMTBIT_S16_LE |
82 SNDRV_PCM_FMTBIT_U16_LE |
83 SNDRV_PCM_FMTBIT_S24_3LE | 78 SNDRV_PCM_FMTBIT_S24_3LE |
84 SNDRV_PCM_FMTBIT_S24_LE | 79 SNDRV_PCM_FMTBIT_S32_LE |
85 SNDRV_PCM_FMTBIT_S32_LE), 80 SNDRV_PCM_FMTBIT_FLOAT_LE),
86 .rates = (SNDRV_PCM_RATE_CONTINUOUS | 81 .rates = (SNDRV_PCM_RATE_CONTINUOUS |
87 SNDRV_PCM_RATE_8000_96000), 82 SNDRV_PCM_RATE_8000_96000),
88 .rate_min = 8000, 83 .rate_min = 8000,
@@ -447,6 +442,7 @@ static struct snd_pcm_ops ct_pcm_playback_ops = {
447 .prepare = ct_pcm_playback_prepare, 442 .prepare = ct_pcm_playback_prepare,
448 .trigger = ct_pcm_playback_trigger, 443 .trigger = ct_pcm_playback_trigger,
449 .pointer = ct_pcm_playback_pointer, 444 .pointer = ct_pcm_playback_pointer,
445 .page = snd_pcm_sgbuf_ops_page,
450}; 446};
451 447
452/* PCM operators for capture */ 448/* PCM operators for capture */
@@ -459,6 +455,7 @@ static struct snd_pcm_ops ct_pcm_capture_ops = {
459 .prepare = ct_pcm_capture_prepare, 455 .prepare = ct_pcm_capture_prepare,
460 .trigger = ct_pcm_capture_trigger, 456 .trigger = ct_pcm_capture_trigger,
461 .pointer = ct_pcm_capture_pointer, 457 .pointer = ct_pcm_capture_pointer,
458 .page = snd_pcm_sgbuf_ops_page,
462}; 459};
463 460
464/* Create ALSA pcm device */ 461/* Create ALSA pcm device */
@@ -469,12 +466,10 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
469 struct snd_pcm *pcm; 466 struct snd_pcm *pcm;
470 int err; 467 int err;
471 int playback_count, capture_count; 468 int playback_count, capture_count;
472 char name[128];
473 469
474 strncpy(name, device_name, sizeof(name));
475 playback_count = (IEC958 == device) ? 1 : 8; 470 playback_count = (IEC958 == device) ? 1 : 8;
476 capture_count = (FRONT == device) ? 1 : 0; 471 capture_count = (FRONT == device) ? 1 : 0;
477 err = snd_pcm_new(atc->card, name, device, 472 err = snd_pcm_new(atc->card, "ctxfi", device,
478 playback_count, capture_count, &pcm); 473 playback_count, capture_count, &pcm);
479 if (err < 0) { 474 if (err < 0) {
480 printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err); 475 printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err);
@@ -484,7 +479,7 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
484 pcm->private_data = atc; 479 pcm->private_data = atc;
485 pcm->info_flags = 0; 480 pcm->info_flags = 0;
486 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; 481 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
487 strcpy(pcm->name, device_name); 482 strlcpy(pcm->name, device_name, sizeof(pcm->name));
488 483
489 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops); 484 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops);
490 485
@@ -492,7 +487,7 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
492 snd_pcm_set_ops(pcm, 487 snd_pcm_set_ops(pcm,
493 SNDRV_PCM_STREAM_CAPTURE, &ct_pcm_capture_ops); 488 SNDRV_PCM_STREAM_CAPTURE, &ct_pcm_capture_ops);
494 489
495 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 490 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
496 snd_dma_pci_data(atc->pci), 128*1024, 128*1024); 491 snd_dma_pci_data(atc->pci), 128*1024, 128*1024);
497 492
498 return 0; 493 return 0;