Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3839e4f136d6da3dc85d237aa9569ee94bfea763
Commit:     3839e4f136d6da3dc85d237aa9569ee94bfea763
Parent:     88aa139057f2740c5dd55e2a542b2425186e4d3c
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 21 16:33:32 2007 +0100
Committer:  Mercurial server <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:30:24 2008 +0100

    [ALSA] emu10k1 - Use enum for emu_model types
    
    Use enum instead of digits for emu_model types.
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 include/sound/emu10k1.h          |    8 ++++++++
 sound/pci/emu10k1/emu10k1_main.c |   29 ++++++++++++++++-------------
 sound/pci/emu10k1/emumixer.c     |   20 ++++++++++++--------
 3 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 4474b4e..494648d 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1642,6 +1642,14 @@ struct snd_emu10k1_midi {
        void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status);
 };
 
+enum {
+       EMU_MODEL_SB,
+       EMU_MODEL_EMU1010,
+       EMU_MODEL_EMU1010B,
+       EMU_MODEL_EMU1616,
+       EMU_MODEL_EMU0404,
+};
+
 struct snd_emu_chip_details {
        u32 vendor;
        u32 device;
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 54b978e..7e46325 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) {
                        /* Return to Audio Dock programming mode */
                        snd_printk(KERN_INFO "emu1010: Loading Audio Dock 
Firmware\n");
                        snd_emu1010_fpga_write(emu,  EMU_HANA_FPGA_CONFIG, 
EMU_HANA_FPGA_CONFIG_AUDIODOCK );
-                       if (emu->card_capabilities->emu_model == 1) {
+                       if (emu->card_capabilities->emu_model ==
+                           EMU_MODEL_EMU1010) {
                                if ((err = snd_emu1010_load_firmware(emu, 
DOCK_FILENAME)) != 0) {
                                        continue;
                                }
-                       } else if (emu->card_capabilities->emu_model == 2) {
+                       } else if (emu->card_capabilities->emu_model ==
+                                  EMU_MODEL_EMU1010B) {
                                if ((err = snd_emu1010_load_firmware(emu, 
MICRO_DOCK_FILENAME)) != 0) {
                                        continue;
                                }
-                       } else if (emu->card_capabilities->emu_model == 3) {
+                       } else if (emu->card_capabilities->emu_model ==
+                                  EMU_MODEL_EMU1616) {
                                if ((err = snd_emu1010_load_firmware(emu, 
MICRO_DOCK_FILENAME)) != 0) {
                                        continue;
                                }
@@ -845,16 +848,16 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * 
emu)
        }
        snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg);
        switch (emu->card_capabilities->emu_model) {
-       case 1:
+       case EMU_MODEL_EMU1010:
                filename = HANA_FILENAME;
                break;
-       case 2:
+       case EMU_MODEL_EMU1010B:
                filename = EMU1010B_FILENAME;
                break;
-       case 3:
+       case EMU_MODEL_EMU1616:
                filename = EMU1010_NOTEBOOK_FILENAME;
                break;
-       case 4:
+       case EMU_MODEL_EMU0404:
                filename = EMU0404_FILENAME;
                break;
        default:
@@ -1103,7 +1106,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * 
emu)
                EMU_DST_HANA_SPDIF_RIGHT1, EMU_SRC_ALICE_EMU32A + 3); /* ALICE2 
bus 0xb3 */
 #endif
        /* Default outputs */
-       if (emu->card_capabilities->emu_model == 3) {
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) {
                /* 1616(M) cardbus default outputs */
                /* ALICE2 bus 0xa0 */
                snd_emu1010_fpga_link_dst_src_write(emu,
@@ -1250,7 +1253,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
                }
                snd_emu10k1_free_efx(emu);
                }
-       if (emu->card_capabilities->emu_model == 1) {
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) {
                /* Disable 48Volt power to Audio Dock */
                snd_emu1010_fpga_write(emu,  EMU_HANA_DOCK_PWR,  0 );
        }
@@ -1394,7 +1397,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .spk71 = 1,
-        .emu_model = 4} , /* EMU 0404 */
+        .emu_model = EMU_MODEL_EMU0404} , /* EMU 0404 */
        /* Tested by [EMAIL PROTECTED] 4th Nov 2007. */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102,
         .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", 
@@ -1403,7 +1406,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .ca0108_chip = 1,
         .ca_cardbus_chip = 1,
         .spk71 = 1 ,
-        .emu_model = 3} ,
+        .emu_model = EMU_MODEL_EMU1616},
        /* Tested by [EMAIL PROTECTED] 4th Nov 2007. */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102,
         .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", 
@@ -1411,7 +1414,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
         .spk71 = 1,
-        .emu_model = 2} ,
+        .emu_model = EMU_MODEL_EMU1010B},
        /* Tested by [EMAIL PROTECTED] 8th July 2005. */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
         .driver = "Audigy2", .name = "E-mu 1010 [4001]",
@@ -1419,7 +1422,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .spk71 = 1,
-        .emu_model = 1} , /* Emu 1010 */
+        .emu_model = EMU_MODEL_EMU1010} , /* Emu 1010 */
        /* Audigy4 (Not PRO) SB0610 */
        {.vendor = 0x1102, .device = 0x0008, 
         .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", 
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 7ebf035..fd22120 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,
 
        uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
        uinfo->count = 1;
-       if (emu->card_capabilities->emu_model == 3) { /* 1616(m) cardbus */
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) {
                uinfo->value.enumerated.items = 49;
                items = emu1616_src_texts;
        } else {
@@ -421,7 +421,8 @@ static int snd_emu1010_output_source_get(struct 
snd_kcontrol *kcontrol,
        channel = (kcontrol->private_value) & 0xff;
        /* Limit: emu1010_output_dst, emu->emu1010.output_source */
        if (channel >= 24 ||
-           (emu->card_capabilities->emu_model == 3 && channel >= 18))
+           (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 &&
+            channel >= 18))
                return -EINVAL;
        ucontrol->value.enumerated.item[0] = 
emu->emu1010.output_source[channel];
        return 0;
@@ -436,17 +437,19 @@ static int snd_emu1010_output_source_put(struct 
snd_kcontrol *kcontrol,
 
        val = ucontrol->value.enumerated.item[0];
        if (val >= 53 ||
-           (emu->card_capabilities->emu_model == 3 && val >= 49))
+           (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 &&
+            val >= 49))
                return -EINVAL;
        channel = (kcontrol->private_value) & 0xff;
        /* Limit: emu1010_output_dst, emu->emu1010.output_source */
        if (channel >= 24 ||
-           (emu->card_capabilities->emu_model == 3 && channel >= 18))
+           (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 &&
+            channel >= 18))
                return -EINVAL;
        if (emu->emu1010.output_source[channel] == val)
                return 0;
        emu->emu1010.output_source[channel] = val;
-       if (emu->card_capabilities->emu_model == 3) /* 1616(m) cardbus */
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616)
                snd_emu1010_fpga_link_dst_src_write(emu,
                        emu1616_output_dst[channel], emu1616_src_regs[val]);
        else
@@ -478,7 +481,8 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol 
*kcontrol,
 
        val = ucontrol->value.enumerated.item[0];
        if (val >= 53 ||
-           (emu->card_capabilities->emu_model == 3 && val >= 49))
+           (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616 &&
+            val >= 49))
                return -EINVAL;
        channel = (kcontrol->private_value) & 0xff;
        /* Limit: emu1010_input_dst, emu->emu1010.input_source */
@@ -487,7 +491,7 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol 
*kcontrol,
        if (emu->emu1010.input_source[channel] == val)
                return 0;
        emu->emu1010.input_source[channel] = val;
-       if (emu->card_capabilities->emu_model == 3) /* 1616(m) cardbus */
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616)
                snd_emu1010_fpga_link_dst_src_write(emu,
                        emu1010_input_dst[channel], emu1616_src_regs[val]);
        else
@@ -1991,7 +1995,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                        return err;
        }
 
-       if (emu->card_capabilities->emu_model == 3) {
+       if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) {
                /* 1616(m) cardbus */
                int i;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to