sound: oxygen: better defaults for upmixing control
authorClemens Ladisch <clemens@ladisch.de>
Mon, 28 Sep 2009 09:15:49 +0000 (11:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 28 Sep 2009 09:54:00 +0000 (11:54 +0200)
On card models with two-channel outputs, the base driver can
automatically disable the upmixing control so that the model
drivers do not need to do this.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/oxygen/hifier.c
sound/pci/oxygen/oxygen_mixer.c
sound/pci/oxygen/xonar_pcm179x.c

index 84ef131834191b9b64c6d2b1ed266a39573ea7d0..9026a143a5ecc7b9b03a8ab0a5b16cb00066d801 100644 (file)
@@ -141,19 +141,11 @@ static void set_cs5340_params(struct oxygen *chip,
 
 static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);
 
-static int hifier_control_filter(struct snd_kcontrol_new *template)
-{
-       if (!strcmp(template->name, "Stereo Upmixing"))
-               return 1; /* stereo only - we don't need upmixing */
-       return 0;
-}
-
 static const struct oxygen_model model_hifier = {
        .shortname = "C-Media CMI8787",
        .longname = "C-Media Oxygen HD Audio",
        .chip = "CMI8788",
        .init = hifier_init,
-       .control_filter = hifier_control_filter,
        .cleanup = hifier_cleanup,
        .resume = hifier_resume,
        .set_dac_params = set_ak4396_params,
index 5401c547c4e33f75e3e8f5186b09d2129b16fc43..e8e911a86c8e60beacbbb5dcc15da8bb44216818 100644 (file)
@@ -954,6 +954,9 @@ static int add_controls(struct oxygen *chip,
                        if (err == 1)
                                continue;
                }
+               if (!strcmp(template.name, "Stereo Upmixing") &&
+                   chip->model.dac_channels == 2)
+                       continue;
                if (!strcmp(template.name, "Master Playback Volume") &&
                    chip->model.dac_tlv) {
                        template.tlv.p = chip->model.dac_tlv;
index 522efde0d52e9475e14afce3d5102d29f24902be..07aaa893d323ae7f19821252506fb2683b7037e6 100644 (file)
@@ -605,8 +605,6 @@ static int xonar_st_control_filter(struct snd_kcontrol_new *template)
 {
        if (!strncmp(template->name, "CD Capture ", 11))
                return 1; /* no CD input */
-       if (!strcmp(template->name, "Stereo Upmixing"))
-               return 1; /* stereo only - we don't need upmixing */
        return 0;
 }