[ALSA] emu10k1 - EMU 1212 with 16 capture channels
[powerpc.git] / sound / pci / emu10k1 / emumixer.c
index b8221f3..7b2c1dc 100644 (file)
@@ -42,7 +42,7 @@
 
 #define AC97_ID_STAC9758       0x83847658
 
-static DECLARE_TLV_DB_SCALE(snd_audigy_db_scale2, -10350, 50, 1); /* WM8775 gain scale */
+static const DECLARE_TLV_DB_SCALE(snd_audigy_db_scale2, -10350, 50, 1); /* WM8775 gain scale */
 
 static int snd_emu10k1_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 {
@@ -77,6 +77,10 @@ static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
+/*
+ * Items labels in enum mixer controls assigning source data to
+ * each destination
+ */
 static char *emu1010_src_texts[] = { 
        "Silence",
        "Dock Mic A",
@@ -133,6 +137,9 @@ static char *emu1010_src_texts[] = {
        "DSP 31",
 };
 
+/*
+ * List of data sources available for each destination
+ */
 static unsigned int emu1010_src_regs[] = {
        EMU_SRC_SILENCE,/* 0 */
        EMU_SRC_DOCK_MIC_A1, /* 1 */
@@ -189,6 +196,10 @@ static unsigned int emu1010_src_regs[] = {
        EMU_SRC_ALICE_EMU32B+0xf, /* 52 */
 };
 
+/*
+ * Data destinations - physical EMU outputs.
+ * Each destination has an enum mixer control to choose a data source
+ */
 static unsigned int emu1010_output_dst[] = {
        EMU_DST_DOCK_DAC1_LEFT1, /* 0 */
        EMU_DST_DOCK_DAC1_RIGHT1, /* 1 */
@@ -216,6 +227,11 @@ static unsigned int emu1010_output_dst[] = {
        EMU_DST_HANA_ADAT+7, /* 23 */
 };
 
+/*
+ * Data destinations - HANA outputs going to Alice2 (audigy) for
+ *   capture (EMU32 + I2S links)
+ * Each destination has an enum mixer control to choose a data source
+ */
 static unsigned int emu1010_input_dst[] = {
        EMU_DST_ALICE2_EMU32_0,
        EMU_DST_ALICE2_EMU32_1,
@@ -1486,6 +1502,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                "Wave Playback Volume", "OLD PCM Playback Volume",
                "Wave Master Playback Volume", "Master Playback Volume",
                "AMic Playback Volume", "Old Mic Playback Volume",
+               "CD Capture Volume", "IEC958 Optical Capture Volume",
                NULL
        };
        static char *audigy_remove_ctls_i2c_adc[] = {
@@ -1494,6 +1511,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                "Mic Capture Volume",
                "Analog Mix Capture Volume",
                "Aux Capture Volume",
+               "IEC958 Optical Capture Volume",
                NULL
        };
        static char *audigy_remove_ctls_1361t_adc[] = {
@@ -1580,6 +1598,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                        if (emu->ac97->id == AC97_ID_STAC9758) {
                                emu->rear_ac97 = 1;
                                snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE|AC97SLOT_REAR_LEFT|AC97SLOT_REAR_RIGHT);
+                               snd_ac97_write_cache(emu->ac97, AC97_HEADPHONE, 0x0202);
                        }
                        /* remove unused AC97 controls */
                        snd_ac97_write_cache(emu->ac97, AC97_SURROUND_MASTER, 0x0202);