diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-04-01 04:02:18 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:30 -0400 |
commit | e97f79994ac715e4c8724b201bd3328463ec9314 (patch) | |
tree | a8cc01dc674185458964ee4636fabce8e71d3726 /sound/pci/oxygen/oxygen.c | |
parent | 0c4cc4430f40089bb85557e309038faa458247f1 (diff) |
[ALSA] oxygen: fix line-in recording selection (now for real)
On C-Media cards, the GPIO pin 0 of the CM9780 must be handled exactly
like on Xonar cards, so move the Xonar code to the common mixer code.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/oxygen.c')
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 511ef34a43ca..b3b7771b54c0 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <sound/tlv.h> | 39 | #include <sound/tlv.h> |
40 | #include "oxygen.h" | 40 | #include "oxygen.h" |
41 | #include "ak4396.h" | 41 | #include "ak4396.h" |
42 | #include "cm9780.h" | ||
43 | #include "wm8785.h" | 42 | #include "wm8785.h" |
44 | 43 | ||
45 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); | 44 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
@@ -79,8 +78,6 @@ MODULE_DEVICE_TABLE(pci, oxygen_ids); | |||
79 | #define GPIO_AK5385_DFS_DOUBLE 0x0001 | 78 | #define GPIO_AK5385_DFS_DOUBLE 0x0001 |
80 | #define GPIO_AK5385_DFS_QUAD 0x0002 | 79 | #define GPIO_AK5385_DFS_QUAD 0x0002 |
81 | 80 | ||
82 | #define GPIO_LINE_MUTE CM9780_GPO0 | ||
83 | |||
84 | struct generic_data { | 81 | struct generic_data { |
85 | u8 ak4396_ctl2; | 82 | u8 ak4396_ctl2; |
86 | }; | 83 | }; |
@@ -145,23 +142,16 @@ static void wm8785_init(struct oxygen *chip) | |||
145 | snd_component_add(chip->card, "WM8785"); | 142 | snd_component_add(chip->card, "WM8785"); |
146 | } | 143 | } |
147 | 144 | ||
148 | static void cmi9780_init(struct oxygen *chip) | ||
149 | { | ||
150 | oxygen_ac97_clear_bits(chip, 0, CM9780_GPIO_STATUS, GPIO_LINE_MUTE); | ||
151 | } | ||
152 | |||
153 | static void generic_init(struct oxygen *chip) | 145 | static void generic_init(struct oxygen *chip) |
154 | { | 146 | { |
155 | ak4396_init(chip); | 147 | ak4396_init(chip); |
156 | wm8785_init(chip); | 148 | wm8785_init(chip); |
157 | cmi9780_init(chip); | ||
158 | } | 149 | } |
159 | 150 | ||
160 | static void meridian_init(struct oxygen *chip) | 151 | static void meridian_init(struct oxygen *chip) |
161 | { | 152 | { |
162 | ak4396_init(chip); | 153 | ak4396_init(chip); |
163 | ak5385_init(chip); | 154 | ak5385_init(chip); |
164 | cmi9780_init(chip); | ||
165 | } | 155 | } |
166 | 156 | ||
167 | static void generic_cleanup(struct oxygen *chip) | 157 | static void generic_cleanup(struct oxygen *chip) |
@@ -257,27 +247,6 @@ static void set_ak5385_params(struct oxygen *chip, | |||
257 | value, GPIO_AK5385_DFS_MASK); | 247 | value, GPIO_AK5385_DFS_MASK); |
258 | } | 248 | } |
259 | 249 | ||
260 | static void cmi9780_switch_hook(struct oxygen *chip, unsigned int codec, | ||
261 | unsigned int reg, int mute) | ||
262 | { | ||
263 | if (codec != 0) | ||
264 | return; | ||
265 | switch (reg) { | ||
266 | case AC97_LINE: | ||
267 | oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS, | ||
268 | mute ? GPIO_LINE_MUTE : 0, | ||
269 | GPIO_LINE_MUTE); | ||
270 | break; | ||
271 | case AC97_MIC: | ||
272 | case AC97_CD: | ||
273 | case AC97_AUX: | ||
274 | if (!mute) | ||
275 | oxygen_ac97_set_bits(chip, 0, CM9780_GPIO_STATUS, | ||
276 | GPIO_LINE_MUTE); | ||
277 | break; | ||
278 | } | ||
279 | } | ||
280 | |||
281 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); | 250 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); |
282 | 251 | ||
283 | static int ak4396_control_filter(struct snd_kcontrol_new *template) | 252 | static int ak4396_control_filter(struct snd_kcontrol_new *template) |
@@ -301,7 +270,6 @@ static const struct oxygen_model model_generic = { | |||
301 | .set_adc_params = set_wm8785_params, | 270 | .set_adc_params = set_wm8785_params, |
302 | .update_dac_volume = update_ak4396_volume, | 271 | .update_dac_volume = update_ak4396_volume, |
303 | .update_dac_mute = update_ak4396_mute, | 272 | .update_dac_mute = update_ak4396_mute, |
304 | .ac97_switch_hook = cmi9780_switch_hook, | ||
305 | .model_data_size = sizeof(struct generic_data), | 273 | .model_data_size = sizeof(struct generic_data), |
306 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 274 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
307 | PLAYBACK_1_TO_SPDIF | | 275 | PLAYBACK_1_TO_SPDIF | |
@@ -327,7 +295,6 @@ static const struct oxygen_model model_meridian = { | |||
327 | .set_adc_params = set_ak5385_params, | 295 | .set_adc_params = set_ak5385_params, |
328 | .update_dac_volume = update_ak4396_volume, | 296 | .update_dac_volume = update_ak4396_volume, |
329 | .update_dac_mute = update_ak4396_mute, | 297 | .update_dac_mute = update_ak4396_mute, |
330 | .ac97_switch_hook = cmi9780_switch_hook, | ||
331 | .model_data_size = sizeof(struct generic_data), | 298 | .model_data_size = sizeof(struct generic_data), |
332 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 299 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
333 | PLAYBACK_1_TO_SPDIF | | 300 | PLAYBACK_1_TO_SPDIF | |