diff options
Diffstat (limited to 'sound/pci/oxygen')
-rw-r--r-- | sound/pci/oxygen/hifier.c | 1 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 35 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_lib.c | 10 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_pcm.c | 2 | ||||
-rw-r--r-- | sound/pci/oxygen/virtuoso.c | 1 |
5 files changed, 43 insertions, 6 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c index 3ea1f05228a1..666f69a3312e 100644 --- a/sound/pci/oxygen/hifier.c +++ b/sound/pci/oxygen/hifier.c | |||
@@ -150,6 +150,7 @@ static const struct oxygen_model model_hifier = { | |||
150 | .shortname = "C-Media CMI8787", | 150 | .shortname = "C-Media CMI8787", |
151 | .longname = "C-Media Oxygen HD Audio", | 151 | .longname = "C-Media Oxygen HD Audio", |
152 | .chip = "CMI8788", | 152 | .chip = "CMI8788", |
153 | .owner = THIS_MODULE, | ||
153 | .init = hifier_init, | 154 | .init = hifier_init, |
154 | .control_filter = hifier_control_filter, | 155 | .control_filter = hifier_control_filter, |
155 | .mixer_init = hifier_mixer_init, | 156 | .mixer_init = hifier_mixer_init, |
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index f31a0eb409b0..9a9941bb0460 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -28,7 +28,9 @@ | |||
28 | * GPIO 1 -> DFS1 of AK5385 | 28 | * GPIO 1 -> DFS1 of AK5385 |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/mutex.h> | ||
31 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
33 | #include <sound/ac97_codec.h> | ||
32 | #include <sound/control.h> | 34 | #include <sound/control.h> |
33 | #include <sound/core.h> | 35 | #include <sound/core.h> |
34 | #include <sound/initval.h> | 36 | #include <sound/initval.h> |
@@ -37,6 +39,7 @@ | |||
37 | #include <sound/tlv.h> | 39 | #include <sound/tlv.h> |
38 | #include "oxygen.h" | 40 | #include "oxygen.h" |
39 | #include "ak4396.h" | 41 | #include "ak4396.h" |
42 | #include "cm9780.h" | ||
40 | 43 | ||
41 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); | 44 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
42 | MODULE_DESCRIPTION("C-Media CMI8788 driver"); | 45 | MODULE_DESCRIPTION("C-Media CMI8788 driver"); |
@@ -75,6 +78,8 @@ MODULE_DEVICE_TABLE(pci, oxygen_ids); | |||
75 | #define GPIO_AK5385_DFS_DOUBLE 0x0001 | 78 | #define GPIO_AK5385_DFS_DOUBLE 0x0001 |
76 | #define GPIO_AK5385_DFS_QUAD 0x0002 | 79 | #define GPIO_AK5385_DFS_QUAD 0x0002 |
77 | 80 | ||
81 | #define GPIO_LINE_MUTE CM9780_GPO0 | ||
82 | |||
78 | #define WM8785_R0 0 | 83 | #define WM8785_R0 0 |
79 | #define WM8785_R1 1 | 84 | #define WM8785_R1 1 |
80 | #define WM8785_R2 2 | 85 | #define WM8785_R2 2 |
@@ -180,16 +185,23 @@ static void wm8785_init(struct oxygen *chip) | |||
180 | snd_component_add(chip->card, "WM8785"); | 185 | snd_component_add(chip->card, "WM8785"); |
181 | } | 186 | } |
182 | 187 | ||
188 | static void cmi9780_init(struct oxygen *chip) | ||
189 | { | ||
190 | oxygen_ac97_clear_bits(chip, 0, CM9780_GPIO_STATUS, GPIO_LINE_MUTE); | ||
191 | } | ||
192 | |||
183 | static void generic_init(struct oxygen *chip) | 193 | static void generic_init(struct oxygen *chip) |
184 | { | 194 | { |
185 | ak4396_init(chip); | 195 | ak4396_init(chip); |
186 | wm8785_init(chip); | 196 | wm8785_init(chip); |
197 | cmi9780_init(chip); | ||
187 | } | 198 | } |
188 | 199 | ||
189 | static void meridian_init(struct oxygen *chip) | 200 | static void meridian_init(struct oxygen *chip) |
190 | { | 201 | { |
191 | ak4396_init(chip); | 202 | ak4396_init(chip); |
192 | ak5385_init(chip); | 203 | ak5385_init(chip); |
204 | cmi9780_init(chip); | ||
193 | } | 205 | } |
194 | 206 | ||
195 | static void generic_cleanup(struct oxygen *chip) | 207 | static void generic_cleanup(struct oxygen *chip) |
@@ -285,6 +297,27 @@ static void set_ak5385_params(struct oxygen *chip, | |||
285 | value, GPIO_AK5385_DFS_MASK); | 297 | value, GPIO_AK5385_DFS_MASK); |
286 | } | 298 | } |
287 | 299 | ||
300 | static void cmi9780_switch_hook(struct oxygen *chip, unsigned int codec, | ||
301 | unsigned int reg, int mute) | ||
302 | { | ||
303 | if (codec != 0) | ||
304 | return; | ||
305 | switch (reg) { | ||
306 | case AC97_LINE: | ||
307 | oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS, | ||
308 | mute ? GPIO_LINE_MUTE : 0, | ||
309 | GPIO_LINE_MUTE); | ||
310 | break; | ||
311 | case AC97_MIC: | ||
312 | case AC97_CD: | ||
313 | case AC97_AUX: | ||
314 | if (!mute) | ||
315 | oxygen_ac97_set_bits(chip, 0, CM9780_GPIO_STATUS, | ||
316 | GPIO_LINE_MUTE); | ||
317 | break; | ||
318 | } | ||
319 | } | ||
320 | |||
288 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); | 321 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); |
289 | 322 | ||
290 | static int ak4396_control_filter(struct snd_kcontrol_new *template) | 323 | static int ak4396_control_filter(struct snd_kcontrol_new *template) |
@@ -308,6 +341,7 @@ static const struct oxygen_model model_generic = { | |||
308 | .set_adc_params = set_wm8785_params, | 341 | .set_adc_params = set_wm8785_params, |
309 | .update_dac_volume = update_ak4396_volume, | 342 | .update_dac_volume = update_ak4396_volume, |
310 | .update_dac_mute = update_ak4396_mute, | 343 | .update_dac_mute = update_ak4396_mute, |
344 | .ac97_switch_hook = cmi9780_switch_hook, | ||
311 | .model_data_size = sizeof(struct generic_data), | 345 | .model_data_size = sizeof(struct generic_data), |
312 | .dac_channels = 8, | 346 | .dac_channels = 8, |
313 | .used_channels = OXYGEN_CHANNEL_A | | 347 | .used_channels = OXYGEN_CHANNEL_A | |
@@ -331,6 +365,7 @@ static const struct oxygen_model model_meridian = { | |||
331 | .set_adc_params = set_ak5385_params, | 365 | .set_adc_params = set_ak5385_params, |
332 | .update_dac_volume = update_ak4396_volume, | 366 | .update_dac_volume = update_ak4396_volume, |
333 | .update_dac_mute = update_ak4396_mute, | 367 | .update_dac_mute = update_ak4396_mute, |
368 | .ac97_switch_hook = cmi9780_switch_hook, | ||
334 | .model_data_size = sizeof(struct generic_data), | 369 | .model_data_size = sizeof(struct generic_data), |
335 | .dac_channels = 8, | 370 | .dac_channels = 8, |
336 | .used_channels = OXYGEN_CHANNEL_B | | 371 | .used_channels = OXYGEN_CHANNEL_B | |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index 6eb36dd11476..78c21155218e 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -204,7 +204,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
204 | mutex_unlock(&chip->mutex); | 204 | mutex_unlock(&chip->mutex); |
205 | } | 205 | } |
206 | 206 | ||
207 | static void __devinit oxygen_proc_init(struct oxygen *chip) | 207 | static void oxygen_proc_init(struct oxygen *chip) |
208 | { | 208 | { |
209 | struct snd_info_entry *entry; | 209 | struct snd_info_entry *entry; |
210 | 210 | ||
@@ -215,7 +215,7 @@ static void __devinit oxygen_proc_init(struct oxygen *chip) | |||
215 | #define oxygen_proc_init(chip) | 215 | #define oxygen_proc_init(chip) |
216 | #endif | 216 | #endif |
217 | 217 | ||
218 | static void __devinit oxygen_init(struct oxygen *chip) | 218 | static void oxygen_init(struct oxygen *chip) |
219 | { | 219 | { |
220 | unsigned int i; | 220 | unsigned int i; |
221 | 221 | ||
@@ -399,8 +399,8 @@ static void oxygen_card_free(struct snd_card *card) | |||
399 | pci_disable_device(chip->pci); | 399 | pci_disable_device(chip->pci); |
400 | } | 400 | } |
401 | 401 | ||
402 | int __devinit oxygen_pci_probe(struct pci_dev *pci, int index, char *id, | 402 | int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, |
403 | int midi, const struct oxygen_model *model) | 403 | int midi, const struct oxygen_model *model) |
404 | { | 404 | { |
405 | struct snd_card *card; | 405 | struct snd_card *card; |
406 | struct oxygen *chip; | 406 | struct oxygen *chip; |
@@ -507,7 +507,7 @@ err_card: | |||
507 | } | 507 | } |
508 | EXPORT_SYMBOL(oxygen_pci_probe); | 508 | EXPORT_SYMBOL(oxygen_pci_probe); |
509 | 509 | ||
510 | void __devexit oxygen_pci_remove(struct pci_dev *pci) | 510 | void oxygen_pci_remove(struct pci_dev *pci) |
511 | { | 511 | { |
512 | snd_card_free(pci_get_drvdata(pci)); | 512 | snd_card_free(pci_get_drvdata(pci)); |
513 | pci_set_drvdata(pci, NULL); | 513 | pci_set_drvdata(pci, NULL); |
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c index dfad3db35c82..b70046aca657 100644 --- a/sound/pci/oxygen/oxygen_pcm.c +++ b/sound/pci/oxygen/oxygen_pcm.c | |||
@@ -634,7 +634,7 @@ static void oxygen_pcm_free(struct snd_pcm *pcm) | |||
634 | snd_pcm_lib_preallocate_free_for_all(pcm); | 634 | snd_pcm_lib_preallocate_free_for_all(pcm); |
635 | } | 635 | } |
636 | 636 | ||
637 | int __devinit oxygen_pcm_init(struct oxygen *chip) | 637 | int oxygen_pcm_init(struct oxygen *chip) |
638 | { | 638 | { |
639 | struct snd_pcm *pcm; | 639 | struct snd_pcm *pcm; |
640 | int outs, ins; | 640 | int outs, ins; |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index 40e92f5cd69c..d163397b85cc 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -389,6 +389,7 @@ static const struct oxygen_model model_xonar = { | |||
389 | .shortname = "Asus AV200", | 389 | .shortname = "Asus AV200", |
390 | .longname = "Asus Virtuoso 200", | 390 | .longname = "Asus Virtuoso 200", |
391 | .chip = "AV200", | 391 | .chip = "AV200", |
392 | .owner = THIS_MODULE, | ||
392 | .init = xonar_init, | 393 | .init = xonar_init, |
393 | .control_filter = xonar_control_filter, | 394 | .control_filter = xonar_control_filter, |
394 | .mixer_init = xonar_mixer_init, | 395 | .mixer_init = xonar_mixer_init, |