diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-12-21 10:33:32 -0500 |
---|---|---|
committer | Mercurial server <hg@alsa0.alsa-project.org> | 2008-01-31 11:30:24 -0500 |
commit | 3839e4f136d6da3dc85d237aa9569ee94bfea763 (patch) | |
tree | c000a5a87e22c22890c24b8eb4f1fee861bbd79a /sound/pci/emu10k1/emumixer.c | |
parent | 88aa139057f2740c5dd55e2a542b2425186e4d3c (diff) |
[ALSA] emu10k1 - Use enum for emu_model types
Use enum instead of digits for emu_model types.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/emu10k1/emumixer.c')
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 7ebf035b6b08..fd221209abcb 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -397,7 +397,7 @@ static int snd_emu1010_input_output_source_info(struct snd_kcontrol *kcontrol, | |||
397 | 397 | ||
398 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 398 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
399 | uinfo->count = 1; | 399 | uinfo->count = 1; |
400 | if (emu->card_capabilities->emu_model == 3) { /* 1616(m) cardbus */ | 400 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) { |
401 | uinfo->value.enumerated.items = 49; | 401 | uinfo->value.enumerated.items = 49; |
402 | items = emu1616_src_texts; | 402 | items = emu1616_src_texts; |
403 | } else { | 403 | } else { |
@@ -421,7 +421,8 @@ static int snd_emu1010_output_source_get(struct snd_kcontrol *kcontrol, | |||
421 | channel = (kcontrol->private_value) & 0xff; | 421 | channel = (kcontrol->private_value) & 0xff; |
422 | /* Limit: emu1010_output_dst, emu->emu1010.output_source */ | 422 | /* Limit: emu1010_output_dst, emu->emu1010.output_source */ |
423 | if (channel >= 24 || | 423 | if (channel >= 24 || |
424 | (emu->card_capabilities->emu_model == 3 && channel >= 18)) | 424 | (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 && |
425 | channel >= 18)) | ||
425 | return -EINVAL; | 426 | return -EINVAL; |
426 | ucontrol->value.enumerated.item[0] = emu->emu1010.output_source[channel]; | 427 | ucontrol->value.enumerated.item[0] = emu->emu1010.output_source[channel]; |
427 | return 0; | 428 | return 0; |
@@ -436,17 +437,19 @@ static int snd_emu1010_output_source_put(struct snd_kcontrol *kcontrol, | |||
436 | 437 | ||
437 | val = ucontrol->value.enumerated.item[0]; | 438 | val = ucontrol->value.enumerated.item[0]; |
438 | if (val >= 53 || | 439 | if (val >= 53 || |
439 | (emu->card_capabilities->emu_model == 3 && val >= 49)) | 440 | (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 && |
441 | val >= 49)) | ||
440 | return -EINVAL; | 442 | return -EINVAL; |
441 | channel = (kcontrol->private_value) & 0xff; | 443 | channel = (kcontrol->private_value) & 0xff; |
442 | /* Limit: emu1010_output_dst, emu->emu1010.output_source */ | 444 | /* Limit: emu1010_output_dst, emu->emu1010.output_source */ |
443 | if (channel >= 24 || | 445 | if (channel >= 24 || |
444 | (emu->card_capabilities->emu_model == 3 && channel >= 18)) | 446 | (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 && |
447 | channel >= 18)) | ||
445 | return -EINVAL; | 448 | return -EINVAL; |
446 | if (emu->emu1010.output_source[channel] == val) | 449 | if (emu->emu1010.output_source[channel] == val) |
447 | return 0; | 450 | return 0; |
448 | emu->emu1010.output_source[channel] = val; | 451 | emu->emu1010.output_source[channel] = val; |
449 | if (emu->card_capabilities->emu_model == 3) /* 1616(m) cardbus */ | 452 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) |
450 | snd_emu1010_fpga_link_dst_src_write(emu, | 453 | snd_emu1010_fpga_link_dst_src_write(emu, |
451 | emu1616_output_dst[channel], emu1616_src_regs[val]); | 454 | emu1616_output_dst[channel], emu1616_src_regs[val]); |
452 | else | 455 | else |
@@ -478,7 +481,8 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol, | |||
478 | 481 | ||
479 | val = ucontrol->value.enumerated.item[0]; | 482 | val = ucontrol->value.enumerated.item[0]; |
480 | if (val >= 53 || | 483 | if (val >= 53 || |
481 | (emu->card_capabilities->emu_model == 3 && val >= 49)) | 484 | (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 && |
485 | val >= 49)) | ||
482 | return -EINVAL; | 486 | return -EINVAL; |
483 | channel = (kcontrol->private_value) & 0xff; | 487 | channel = (kcontrol->private_value) & 0xff; |
484 | /* Limit: emu1010_input_dst, emu->emu1010.input_source */ | 488 | /* Limit: emu1010_input_dst, emu->emu1010.input_source */ |
@@ -487,7 +491,7 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol, | |||
487 | if (emu->emu1010.input_source[channel] == val) | 491 | if (emu->emu1010.input_source[channel] == val) |
488 | return 0; | 492 | return 0; |
489 | emu->emu1010.input_source[channel] = val; | 493 | emu->emu1010.input_source[channel] = val; |
490 | if (emu->card_capabilities->emu_model == 3) /* 1616(m) cardbus */ | 494 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) |
491 | snd_emu1010_fpga_link_dst_src_write(emu, | 495 | snd_emu1010_fpga_link_dst_src_write(emu, |
492 | emu1010_input_dst[channel], emu1616_src_regs[val]); | 496 | emu1010_input_dst[channel], emu1616_src_regs[val]); |
493 | else | 497 | else |
@@ -1991,7 +1995,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, | |||
1991 | return err; | 1995 | return err; |
1992 | } | 1996 | } |
1993 | 1997 | ||
1994 | if (emu->card_capabilities->emu_model == 3) { | 1998 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) { |
1995 | /* 1616(m) cardbus */ | 1999 | /* 1616(m) cardbus */ |
1996 | int i; | 2000 | int i; |
1997 | 2001 | ||