diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-10-04 13:21:52 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-10-05 18:11:17 +0200 |
commit | b6ca8ab399d913eed0d89d65d6b768337a3d20d7 (patch) | |
tree | 8167dd43f99c4f451cd73853da777d39812cb747 /sound/pci | |
parent | 45bc307f328c044e69cad2a18a9ae972bb15f254 (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')
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 3 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.h | 1 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 3 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_cs43xx.c | 8 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_pcm179x.c | 11 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_wm87x6.c | 8 |
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 = { PLAYBACK_2_TO_AC97_1 | CAPTURE_0_FROM_I2S_1 | CAPTURE_1_FROM_SPDIF | - CAPTURE_2_FROM_AC97_1, + CAPTURE_2_FROM_AC97_1 | + AC97_CD_INPUT, .dac_channels = 8, .dac_volume_min = 0, .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 @@ /* CAPTURE_3_FROM_I2S_3 not implemented */ #define MIDI_OUTPUT 0x0800 #define MIDI_INPUT 0x1000 +#define AC97_CD_INPUT 0x2000 enum { 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, if (!strcmp(template.name, "Stereo Upmixing") && chip->model.dac_channels == 2) continue; + if (!strncmp(template.name, "CD Capture ", 11) && + !(chip->model.device_config & AC97_CD_INPUT)) + continue; if (!strcmp(template.name, "Master Playback Volume") && chip->model.dac_tlv) { 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, static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -6000, 100, 0); -static int xonar_d1_control_filter(struct snd_kcontrol_new *template) -{ - if (!strncmp(template->name, "CD Capture ", 11)) - return 1; /* no CD input */ - return 0; -} - static int xonar_d1_mixer_init(struct oxygen *chip) { int err; @@ -391,7 +384,6 @@ static const struct oxygen_model model_xonar_d1 = { .longname = "Asus Virtuoso 100", .chip = "AV200", .init = xonar_d1_init, - .control_filter = xonar_d1_control_filter, .mixer_init = xonar_d1_mixer_init, .cleanup = xonar_d1_cleanup, .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) return 0; } -static int xonar_st_control_filter(struct snd_kcontrol_new *template) -{ - if (!strncmp(template->name, "CD Capture ", 11)) - return 1; /* no CD input */ - return 0; -} - static int add_pcm1796_controls(struct oxygen *chip) { int err; @@ -991,7 +984,8 @@ static const struct oxygen_model model_xonar_d2 = { CAPTURE_0_FROM_I2S_2 | CAPTURE_1_FROM_SPDIF | MIDI_OUTPUT | - MIDI_INPUT, + MIDI_INPUT | + AC97_CD_INPUT, .dac_channels = 8, .dac_volume_min = 255 - 2*60, .dac_volume_max = 255, @@ -1037,7 +1031,6 @@ static const struct oxygen_model model_xonar_st = { .longname = "Asus Virtuoso 100", .chip = "AV200", .init = xonar_st_init, - .control_filter = xonar_st_control_filter, .mixer_init = xonar_st_mixer_init, .cleanup = xonar_st_cleanup, .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[] = { LC_CONTROL_ALC, wm8776_ngth_db_scale), }; -static int xonar_ds_control_filter(struct snd_kcontrol_new *template) -{ - if (!strncmp(template->name, "CD Capture ", 11)) - return 1; /* no CD input */ - return 0; -} - static int xonar_ds_mixer_init(struct oxygen *chip) { struct xonar_wm87x6 *data = chip->model_data; @@ -1074,7 +1067,6 @@ static const struct oxygen_model model_xonar_ds = { .longname = "Asus Virtuoso 66", .chip = "AV200", .init = xonar_ds_init, - .control_filter = xonar_ds_control_filter, .mixer_init = xonar_ds_mixer_init, .cleanup = xonar_ds_cleanup, .suspend = xonar_ds_suspend, |