ALSA: make snd_ac97_add_vmaster() static
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / sound / pci / ac97 / ac97_codec.c
index 45fd29017ddd59ded7e731ece20c977a4a4bde20..8c49a00a5e3919d835b3f5d3a6fe0569eafda80d 100644 (file)
@@ -49,8 +49,9 @@ MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
 
 #ifdef CONFIG_SND_AC97_POWER_SAVE
 static int power_save = CONFIG_SND_AC97_POWER_SAVE_DEFAULT;
-module_param(power_save, bool, 0644);
-MODULE_PARM_DESC(power_save, "Enable AC97 power-saving control");
+module_param(power_save, int, 0644);
+MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
+                "(in second, 0 = disable).");
 #endif
 /*
 
@@ -160,6 +161,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
 { 0x50534304, 0xffffffff, "UCB1400",           patch_ucb1400,  NULL },
 { 0x53494c20, 0xffffffe0, "Si3036,8",          mpatch_si3036,  mpatch_si3036, AC97_MODEM_PATCH },
 { 0x54524102, 0xffffffff, "TR28022",           NULL,           NULL },
+{ 0x54524103, 0xffffffff, "TR28023",           NULL,           NULL },
 { 0x54524106, 0xffffffff, "TR28026",           NULL,           NULL },
 { 0x54524108, 0xffffffff, "TR28028",           patch_tritech_tr28028,  NULL }, // added by xin jin [07/09/99]
 { 0x54524123, 0xffffffff, "TR28602",           NULL,           NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)]
@@ -168,7 +170,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
 { 0x56494170, 0xffffffff, "VIA1617A",          patch_vt1617a,  NULL }, // modified VT1616 with S/PDIF
 { 0x56494182, 0xffffffff, "VIA1618",           NULL,           NULL },
 { 0x57454301, 0xffffffff, "W83971D",           NULL,           NULL },
-{ 0x574d4c00, 0xffffffff, "WM9701A",           NULL,           NULL },
+{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A",    NULL,           NULL },
 { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
 { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q",   patch_wolfson04, NULL},
 { 0x574d4C05, 0xffffffff, "WM9705,WM9710",     patch_wolfson05, NULL},
@@ -2294,9 +2296,11 @@ static void snd_ac97_powerdown(struct snd_ac97 *ac97)
        power |= AC97_PD_PR0 | AC97_PD_PR1;     /* ADC & DAC powerdown */
        snd_ac97_write(ac97, AC97_POWERDOWN, power);
        udelay(100);
-       power |= AC97_PD_PR2 | AC97_PD_PR3;     /* Analog Mixer powerdown */
+       power |= AC97_PD_PR2;   /* Analog Mixer powerdown (Vref on) */
        snd_ac97_write(ac97, AC97_POWERDOWN, power);
        if (ac97_is_power_save_mode(ac97)) {
+               power |= AC97_PD_PR3;   /* Analog Mixer powerdown */
+               snd_ac97_write(ac97, AC97_POWERDOWN, power);
                udelay(100);
                /* AC-link powerdown, internal Clk disable */
                /* FIXME: this may cause click noises on some boards */
@@ -2362,7 +2366,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
                 *  that open/close frequently)
                 */
                schedule_delayed_work(&ac97->power_work,
-                                     msecs_to_jiffies(2000));
+                                     msecs_to_jiffies(power_save * 1000));
        else {
                cancel_delayed_work(&ac97->power_work);
                update_power_regs(ac97);