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 | |
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')
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 29 | ||||
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 20 |
2 files changed, 28 insertions, 21 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 54b978e74f58..7e46325974a5 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -725,15 +725,18 @@ int emu1010_firmware_thread(void *data) { | |||
725 | /* Return to Audio Dock programming mode */ | 725 | /* Return to Audio Dock programming mode */ |
726 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); | 726 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); |
727 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); | 727 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); |
728 | if (emu->card_capabilities->emu_model == 1) { | 728 | if (emu->card_capabilities->emu_model == |
729 | EMU_MODEL_EMU1010) { | ||
729 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { | 730 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { |
730 | continue; | 731 | continue; |
731 | } | 732 | } |
732 | } else if (emu->card_capabilities->emu_model == 2) { | 733 | } else if (emu->card_capabilities->emu_model == |
734 | EMU_MODEL_EMU1010B) { | ||
733 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | 735 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { |
734 | continue; | 736 | continue; |
735 | } | 737 | } |
736 | } else if (emu->card_capabilities->emu_model == 3) { | 738 | } else if (emu->card_capabilities->emu_model == |
739 | EMU_MODEL_EMU1616) { | ||
737 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | 740 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { |
738 | continue; | 741 | continue; |
739 | } | 742 | } |
@@ -845,16 +848,16 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
845 | } | 848 | } |
846 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); | 849 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); |
847 | switch (emu->card_capabilities->emu_model) { | 850 | switch (emu->card_capabilities->emu_model) { |
848 | case 1: | 851 | case EMU_MODEL_EMU1010: |
849 | filename = HANA_FILENAME; | 852 | filename = HANA_FILENAME; |
850 | break; | 853 | break; |
851 | case 2: | 854 | case EMU_MODEL_EMU1010B: |
852 | filename = EMU1010B_FILENAME; | 855 | filename = EMU1010B_FILENAME; |
853 | break; | 856 | break; |
854 | case 3: | 857 | case EMU_MODEL_EMU1616: |
855 | filename = EMU1010_NOTEBOOK_FILENAME; | 858 | filename = EMU1010_NOTEBOOK_FILENAME; |
856 | break; | 859 | break; |
857 | case 4: | 860 | case EMU_MODEL_EMU0404: |
858 | filename = EMU0404_FILENAME; | 861 | filename = EMU0404_FILENAME; |
859 | break; | 862 | break; |
860 | default: | 863 | default: |
@@ -1103,7 +1106,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
1103 | EMU_DST_HANA_SPDIF_RIGHT1, EMU_SRC_ALICE_EMU32A + 3); /* ALICE2 bus 0xb3 */ | 1106 | EMU_DST_HANA_SPDIF_RIGHT1, EMU_SRC_ALICE_EMU32A + 3); /* ALICE2 bus 0xb3 */ |
1104 | #endif | 1107 | #endif |
1105 | /* Default outputs */ | 1108 | /* Default outputs */ |
1106 | if (emu->card_capabilities->emu_model == 3) { | 1109 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) { |
1107 | /* 1616(M) cardbus default outputs */ | 1110 | /* 1616(M) cardbus default outputs */ |
1108 | /* ALICE2 bus 0xa0 */ | 1111 | /* ALICE2 bus 0xa0 */ |
1109 | snd_emu1010_fpga_link_dst_src_write(emu, | 1112 | snd_emu1010_fpga_link_dst_src_write(emu, |
@@ -1250,7 +1253,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu) | |||
1250 | } | 1253 | } |
1251 | snd_emu10k1_free_efx(emu); | 1254 | snd_emu10k1_free_efx(emu); |
1252 | } | 1255 | } |
1253 | if (emu->card_capabilities->emu_model == 1) { | 1256 | if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) { |
1254 | /* Disable 48Volt power to Audio Dock */ | 1257 | /* Disable 48Volt power to Audio Dock */ |
1255 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); | 1258 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); |
1256 | } | 1259 | } |
@@ -1394,7 +1397,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1394 | .emu10k2_chip = 1, | 1397 | .emu10k2_chip = 1, |
1395 | .ca0102_chip = 1, | 1398 | .ca0102_chip = 1, |
1396 | .spk71 = 1, | 1399 | .spk71 = 1, |
1397 | .emu_model = 4} , /* EMU 0404 */ | 1400 | .emu_model = EMU_MODEL_EMU0404} , /* EMU 0404 */ |
1398 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ | 1401 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ |
1399 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102, | 1402 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102, |
1400 | .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", | 1403 | .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", |
@@ -1403,7 +1406,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1403 | .ca0108_chip = 1, | 1406 | .ca0108_chip = 1, |
1404 | .ca_cardbus_chip = 1, | 1407 | .ca_cardbus_chip = 1, |
1405 | .spk71 = 1 , | 1408 | .spk71 = 1 , |
1406 | .emu_model = 3} , | 1409 | .emu_model = EMU_MODEL_EMU1616}, |
1407 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ | 1410 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ |
1408 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, | 1411 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, |
1409 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", | 1412 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", |
@@ -1411,7 +1414,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1411 | .emu10k2_chip = 1, | 1414 | .emu10k2_chip = 1, |
1412 | .ca0108_chip = 1, | 1415 | .ca0108_chip = 1, |
1413 | .spk71 = 1, | 1416 | .spk71 = 1, |
1414 | .emu_model = 2} , | 1417 | .emu_model = EMU_MODEL_EMU1010B}, |
1415 | /* Tested by James@superbug.co.uk 8th July 2005. */ | 1418 | /* Tested by James@superbug.co.uk 8th July 2005. */ |
1416 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, | 1419 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, |
1417 | .driver = "Audigy2", .name = "E-mu 1010 [4001]", | 1420 | .driver = "Audigy2", .name = "E-mu 1010 [4001]", |
@@ -1419,7 +1422,7 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1419 | .emu10k2_chip = 1, | 1422 | .emu10k2_chip = 1, |
1420 | .ca0102_chip = 1, | 1423 | .ca0102_chip = 1, |
1421 | .spk71 = 1, | 1424 | .spk71 = 1, |
1422 | .emu_model = 1} , /* Emu 1010 */ | 1425 | .emu_model = EMU_MODEL_EMU1010} , /* Emu 1010 */ |
1423 | /* Audigy4 (Not PRO) SB0610 */ | 1426 | /* Audigy4 (Not PRO) SB0610 */ |
1424 | {.vendor = 0x1102, .device = 0x0008, | 1427 | {.vendor = 0x1102, .device = 0x0008, |
1425 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", | 1428 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", |
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 | ||