aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-02 08:27:56 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-02 09:54:46 -0400
commit8372d4980fbc2e403f0dc5457441c8c6b7c04915 (patch)
treedf725a6649b21bc698e9ee21349489967e026419 /sound/pci/ctxfi
parent6585db943aade186d38eaab2720c18887b94c875 (diff)
ALSA: ctxfi - Fix PCM device naming
PCM names for surround streams should be also fixed as well as the mixer element names. Also, a bit clean up for PCM name setup. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r--sound/pci/ctxfi/ctatc.c8
-rw-r--r--sound/pci/ctxfi/ctatc.h4
-rw-r--r--sound/pci/ctxfi/ctpcm.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index e14ed714721b..675dd4c8eaec 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -72,15 +72,15 @@ static struct {
72 [FRONT] = { .create = ct_alsa_pcm_create, 72 [FRONT] = { .create = ct_alsa_pcm_create,
73 .destroy = NULL, 73 .destroy = NULL,
74 .public_name = "Front/WaveIn"}, 74 .public_name = "Front/WaveIn"},
75 [REAR] = { .create = ct_alsa_pcm_create, 75 [SURROUND] = { .create = ct_alsa_pcm_create,
76 .destroy = NULL, 76 .destroy = NULL,
77 .public_name = "Rear"}, 77 .public_name = "Surround"},
78 [CLFE] = { .create = ct_alsa_pcm_create, 78 [CLFE] = { .create = ct_alsa_pcm_create,
79 .destroy = NULL, 79 .destroy = NULL,
80 .public_name = "Center/LFE"}, 80 .public_name = "Center/LFE"},
81 [SURROUND] = { .create = ct_alsa_pcm_create, 81 [SIDE] = { .create = ct_alsa_pcm_create,
82 .destroy = NULL, 82 .destroy = NULL,
83 .public_name = "Surround"}, 83 .public_name = "Side"},
84 [IEC958] = { .create = ct_alsa_pcm_create, 84 [IEC958] = { .create = ct_alsa_pcm_create,
85 .destroy = NULL, 85 .destroy = NULL,
86 .public_name = "IEC958 Non-audio"}, 86 .public_name = "IEC958 Non-audio"},
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h
index a7b0ec24cd75..b86d12cd4a19 100644
--- a/sound/pci/ctxfi/ctatc.h
+++ b/sound/pci/ctxfi/ctatc.h
@@ -29,9 +29,9 @@
29 29
30enum CTALSADEVS { /* Types of alsa devices */ 30enum CTALSADEVS { /* Types of alsa devices */
31 FRONT, 31 FRONT,
32 REAR,
33 CLFE,
34 SURROUND, 32 SURROUND,
33 CLFE,
34 SIDE,
35 IEC958, 35 IEC958,
36 MIXER, 36 MIXER,
37 NUM_CTALSADEVS /* This should always be the last */ 37 NUM_CTALSADEVS /* This should always be the last */
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index a64cb0ed8759..756d8b2776b3 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -469,12 +469,10 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
469 struct snd_pcm *pcm; 469 struct snd_pcm *pcm;
470 int err; 470 int err;
471 int playback_count, capture_count; 471 int playback_count, capture_count;
472 char name[128];
473 472
474 strncpy(name, device_name, sizeof(name));
475 playback_count = (IEC958 == device) ? 1 : 8; 473 playback_count = (IEC958 == device) ? 1 : 8;
476 capture_count = (FRONT == device) ? 1 : 0; 474 capture_count = (FRONT == device) ? 1 : 0;
477 err = snd_pcm_new(atc->card, name, device, 475 err = snd_pcm_new(atc->card, "ctxfi", device,
478 playback_count, capture_count, &pcm); 476 playback_count, capture_count, &pcm);
479 if (err < 0) { 477 if (err < 0) {
480 printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err); 478 printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err);
@@ -484,7 +482,7 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
484 pcm->private_data = atc; 482 pcm->private_data = atc;
485 pcm->info_flags = 0; 483 pcm->info_flags = 0;
486 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; 484 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
487 strcpy(pcm->name, device_name); 485 strlcpy(pcm->name, device_name, sizeof(pcm->name));
488 486
489 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops); 487 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops);
490 488