aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-10-04 07:21:52 -0400
committerTakashi Iwai <tiwai@suse.de>2010-10-05 12:11:17 -0400
commitb6ca8ab399d913eed0d89d65d6b768337a3d20d7 (patch)
tree8167dd43f99c4f451cd73853da777d39812cb747 /sound/pci/oxygen
parent45bc307f328c044e69cad2a18a9ae972bb15f254 (diff)
ALSA: oxygen: handle CD input configuration with a flag
There are more models without a CD input than with one, so handle this explicitly with a device_config flag to avoid having to define a control filter callback to filter it out. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen')
-rw-r--r--sound/pci/oxygen/oxygen.c3
-rw-r--r--sound/pci/oxygen/oxygen.h1
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c3
-rw-r--r--sound/pci/oxygen/xonar_cs43xx.c8
-rw-r--r--sound/pci/oxygen/xonar_pcm179x.c11
-rw-r--r--sound/pci/oxygen/xonar_wm87x6.c8
6 files changed, 8 insertions, 26 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index 289cb4dacfc7..f4fdf6dac800 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -505,7 +505,8 @@ static const struct oxygen_model model_generic = {
505 PLAYBACK_2_TO_AC97_1 | 505 PLAYBACK_2_TO_AC97_1 |
506 CAPTURE_0_FROM_I2S_1 | 506 CAPTURE_0_FROM_I2S_1 |
507 CAPTURE_1_FROM_SPDIF | 507 CAPTURE_1_FROM_SPDIF |
508 CAPTURE_2_FROM_AC97_1, 508 CAPTURE_2_FROM_AC97_1 |
509 AC97_CD_INPUT,
509 .dac_channels = 8, 510 .dac_channels = 8,
510 .dac_volume_min = 0, 511 .dac_volume_min = 0,
511 .dac_volume_max = 255, 512 .dac_volume_max = 255,
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h
index a3409edcfb50..7d5222caa0a9 100644
--- a/sound/pci/oxygen/oxygen.h
+++ b/sound/pci/oxygen/oxygen.h
@@ -34,6 +34,7 @@
34 /* CAPTURE_3_FROM_I2S_3 not implemented */ 34 /* CAPTURE_3_FROM_I2S_3 not implemented */
35#define MIDI_OUTPUT 0x0800 35#define MIDI_OUTPUT 0x0800
36#define MIDI_INPUT 0x1000 36#define MIDI_INPUT 0x1000
37#define AC97_CD_INPUT 0x2000
37 38
38enum { 39enum {
39 CONTROL_SPDIF_PCM, 40 CONTROL_SPDIF_PCM,
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index f375b8a27862..7d40ba8db9fc 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -972,6 +972,9 @@ static int add_controls(struct oxygen *chip,
972 if (!strcmp(template.name, "Stereo Upmixing") && 972 if (!strcmp(template.name, "Stereo Upmixing") &&
973 chip->model.dac_channels == 2) 973 chip->model.dac_channels == 2)
974 continue; 974 continue;
975 if (!strncmp(template.name, "CD Capture ", 11) &&
976 !(chip->model.device_config & AC97_CD_INPUT))
977 continue;
975 if (!strcmp(template.name, "Master Playback Volume") && 978 if (!strcmp(template.name, "Master Playback Volume") &&
976 chip->model.dac_tlv) { 979 chip->model.dac_tlv) {
977 template.tlv.p = chip->model.dac_tlv; 980 template.tlv.p = chip->model.dac_tlv;
diff --git a/sound/pci/oxygen/xonar_cs43xx.c b/sound/pci/oxygen/xonar_cs43xx.c
index 7c4986b27f2b..aa27c31049af 100644
--- a/sound/pci/oxygen/xonar_cs43xx.c
+++ b/sound/pci/oxygen/xonar_cs43xx.c
@@ -367,13 +367,6 @@ static void xonar_d1_line_mic_ac97_switch(struct oxygen *chip,
367 367
368static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -6000, 100, 0); 368static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -6000, 100, 0);
369 369
370static int xonar_d1_control_filter(struct snd_kcontrol_new *template)
371{
372 if (!strncmp(template->name, "CD Capture ", 11))
373 return 1; /* no CD input */
374 return 0;
375}
376
377static int xonar_d1_mixer_init(struct oxygen *chip) 370static int xonar_d1_mixer_init(struct oxygen *chip)
378{ 371{
379 int err; 372 int err;
@@ -391,7 +384,6 @@ static const struct oxygen_model model_xonar_d1 = {
391 .longname = "Asus Virtuoso 100", 384 .longname = "Asus Virtuoso 100",
392 .chip = "AV200", 385 .chip = "AV200",
393 .init = xonar_d1_init, 386 .init = xonar_d1_init,
394 .control_filter = xonar_d1_control_filter,
395 .mixer_init = xonar_d1_mixer_init, 387 .mixer_init = xonar_d1_mixer_init,
396 .cleanup = xonar_d1_cleanup, 388 .cleanup = xonar_d1_cleanup,
397 .suspend = xonar_d1_suspend, 389 .suspend = xonar_d1_suspend,
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c
index ba18fb546b4f..338f88567f57 100644
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -915,13 +915,6 @@ static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
915 return 0; 915 return 0;
916} 916}
917 917
918static int xonar_st_control_filter(struct snd_kcontrol_new *template)
919{
920 if (!strncmp(template->name, "CD Capture ", 11))
921 return 1; /* no CD input */
922 return 0;
923}
924
925static int add_pcm1796_controls(struct oxygen *chip) 918static int add_pcm1796_controls(struct oxygen *chip)
926{ 919{
927 int err; 920 int err;
@@ -991,7 +984,8 @@ static const struct oxygen_model model_xonar_d2 = {
991 CAPTURE_0_FROM_I2S_2 | 984 CAPTURE_0_FROM_I2S_2 |
992 CAPTURE_1_FROM_SPDIF | 985 CAPTURE_1_FROM_SPDIF |
993 MIDI_OUTPUT | 986 MIDI_OUTPUT |
994 MIDI_INPUT, 987 MIDI_INPUT |
988 AC97_CD_INPUT,
995 .dac_channels = 8, 989 .dac_channels = 8,
996 .dac_volume_min = 255 - 2*60, 990 .dac_volume_min = 255 - 2*60,
997 .dac_volume_max = 255, 991 .dac_volume_max = 255,
@@ -1037,7 +1031,6 @@ static const struct oxygen_model model_xonar_st = {
1037 .longname = "Asus Virtuoso 100", 1031 .longname = "Asus Virtuoso 100",
1038 .chip = "AV200", 1032 .chip = "AV200",
1039 .init = xonar_st_init, 1033 .init = xonar_st_init,
1040 .control_filter = xonar_st_control_filter,
1041 .mixer_init = xonar_st_mixer_init, 1034 .mixer_init = xonar_st_mixer_init,
1042 .cleanup = xonar_st_cleanup, 1035 .cleanup = xonar_st_cleanup,
1043 .suspend = xonar_st_suspend, 1036 .suspend = xonar_st_suspend,
diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c
index 5f9f59c10198..200f7601276f 100644
--- a/sound/pci/oxygen/xonar_wm87x6.c
+++ b/sound/pci/oxygen/xonar_wm87x6.c
@@ -1028,13 +1028,6 @@ static const struct snd_kcontrol_new lc_controls[] = {
1028 LC_CONTROL_ALC, wm8776_ngth_db_scale), 1028 LC_CONTROL_ALC, wm8776_ngth_db_scale),
1029}; 1029};
1030 1030
1031static int xonar_ds_control_filter(struct snd_kcontrol_new *template)
1032{
1033 if (!strncmp(template->name, "CD Capture ", 11))
1034 return 1; /* no CD input */
1035 return 0;
1036}
1037
1038static int xonar_ds_mixer_init(struct oxygen *chip) 1031static int xonar_ds_mixer_init(struct oxygen *chip)
1039{ 1032{
1040 struct xonar_wm87x6 *data = chip->model_data; 1033 struct xonar_wm87x6 *data = chip->model_data;
@@ -1074,7 +1067,6 @@ static const struct oxygen_model model_xonar_ds = {
1074 .longname = "Asus Virtuoso 66", 1067 .longname = "Asus Virtuoso 66",
1075 .chip = "AV200", 1068 .chip = "AV200",
1076 .init = xonar_ds_init, 1069 .init = xonar_ds_init,
1077 .control_filter = xonar_ds_control_filter,
1078 .mixer_init = xonar_ds_mixer_init, 1070 .mixer_init = xonar_ds_mixer_init,
1079 .cleanup = xonar_ds_cleanup, 1071 .cleanup = xonar_ds_cleanup,
1080 .suspend = xonar_ds_suspend, 1072 .suspend = xonar_ds_suspend,