aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2009-09-28 05:15:49 -0400
committerTakashi Iwai <tiwai@suse.de>2009-09-28 05:54:00 -0400
commit75919d7c057be888c7cd7b192fad02182260b04a (patch)
tree12aa926b269175b2b7bb8cb0c7ebf4e33936e978
parent268304f4c4f0b8677d67400f04ad4e0271ec3742 (diff)
sound: oxygen: better defaults for upmixing control
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>
-rw-r--r--sound/pci/oxygen/hifier.c8
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c3
-rw-r--r--sound/pci/oxygen/xonar_pcm179x.c2
3 files changed, 3 insertions, 10 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c
index 84ef13183419..9026a143a5ec 100644
--- a/sound/pci/oxygen/hifier.c
+++ b/sound/pci/oxygen/hifier.c
@@ -141,19 +141,11 @@ static void set_cs5340_params(struct oxygen *chip,
141 141
142static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); 142static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);
143 143
144static int hifier_control_filter(struct snd_kcontrol_new *template)
145{
146 if (!strcmp(template->name, "Stereo Upmixing"))
147 return 1; /* stereo only - we don't need upmixing */
148 return 0;
149}
150
151static const struct oxygen_model model_hifier = { 144static const struct oxygen_model model_hifier = {
152 .shortname = "C-Media CMI8787", 145 .shortname = "C-Media CMI8787",
153 .longname = "C-Media Oxygen HD Audio", 146 .longname = "C-Media Oxygen HD Audio",
154 .chip = "CMI8788", 147 .chip = "CMI8788",
155 .init = hifier_init, 148 .init = hifier_init,
156 .control_filter = hifier_control_filter,
157 .cleanup = hifier_cleanup, 149 .cleanup = hifier_cleanup,
158 .resume = hifier_resume, 150 .resume = hifier_resume,
159 .set_dac_params = set_ak4396_params, 151 .set_dac_params = set_ak4396_params,
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index 5401c547c4e3..e8e911a86c8e 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -954,6 +954,9 @@ static int add_controls(struct oxygen *chip,
954 if (err == 1) 954 if (err == 1)
955 continue; 955 continue;
956 } 956 }
957 if (!strcmp(template.name, "Stereo Upmixing") &&
958 chip->model.dac_channels == 2)
959 continue;
957 if (!strcmp(template.name, "Master Playback Volume") && 960 if (!strcmp(template.name, "Master Playback Volume") &&
958 chip->model.dac_tlv) { 961 chip->model.dac_tlv) {
959 template.tlv.p = chip->model.dac_tlv; 962 template.tlv.p = chip->model.dac_tlv;
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c
index 522efde0d52e..07aaa893d323 100644
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -605,8 +605,6 @@ static int xonar_st_control_filter(struct snd_kcontrol_new *template)
605{ 605{
606 if (!strncmp(template->name, "CD Capture ", 11)) 606 if (!strncmp(template->name, "CD Capture ", 11))
607 return 1; /* no CD input */ 607 return 1; /* no CD input */
608 if (!strcmp(template->name, "Stereo Upmixing"))
609 return 1; /* stereo only - we don't need upmixing */
610 return 0; 608 return 0;
611} 609}
612 610