diff options
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 3bfb2102fc5d..bbed644bf9c5 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -35,9 +35,9 @@ | |||
35 | #include <sound/ac97_codec.h> | 35 | #include <sound/ac97_codec.h> |
36 | #include <sound/asoundef.h> | 36 | #include <sound/asoundef.h> |
37 | #include <sound/initval.h> | 37 | #include <sound/initval.h> |
38 | #include "ac97_local.h" | ||
39 | #include "ac97_id.h" | 38 | #include "ac97_id.h" |
40 | #include "ac97_patch.h" | 39 | |
40 | #include "ac97_patch.c" | ||
41 | 41 | ||
42 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); | 42 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); |
43 | MODULE_DESCRIPTION("Universal interface for Audio Codec '97"); | 43 | MODULE_DESCRIPTION("Universal interface for Audio Codec '97"); |
@@ -432,7 +432,8 @@ static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 *ac97, int codec, uns | |||
432 | * Controls | 432 | * Controls |
433 | */ | 433 | */ |
434 | 434 | ||
435 | int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 435 | static int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, |
436 | struct snd_ctl_elem_info *uinfo) | ||
436 | { | 437 | { |
437 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; | 438 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; |
438 | 439 | ||
@@ -446,7 +447,8 @@ int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
446 | return 0; | 447 | return 0; |
447 | } | 448 | } |
448 | 449 | ||
449 | int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 450 | static int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, |
451 | struct snd_ctl_elem_value *ucontrol) | ||
450 | { | 452 | { |
451 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); | 453 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
452 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; | 454 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; |
@@ -462,7 +464,8 @@ int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
462 | return 0; | 464 | return 0; |
463 | } | 465 | } |
464 | 466 | ||
465 | int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 467 | static int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol, |
468 | struct snd_ctl_elem_value *ucontrol) | ||
466 | { | 469 | { |
467 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); | 470 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
468 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; | 471 | struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value; |
@@ -508,7 +511,8 @@ static void snd_ac97_page_restore(struct snd_ac97 *ac97, int page_save) | |||
508 | } | 511 | } |
509 | 512 | ||
510 | /* volume and switch controls */ | 513 | /* volume and switch controls */ |
511 | int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 514 | static int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, |
515 | struct snd_ctl_elem_info *uinfo) | ||
512 | { | 516 | { |
513 | int mask = (kcontrol->private_value >> 16) & 0xff; | 517 | int mask = (kcontrol->private_value >> 16) & 0xff; |
514 | int shift = (kcontrol->private_value >> 8) & 0x0f; | 518 | int shift = (kcontrol->private_value >> 8) & 0x0f; |
@@ -521,7 +525,8 @@ int snd_ac97_info_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info | |||
521 | return 0; | 525 | return 0; |
522 | } | 526 | } |
523 | 527 | ||
524 | int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 528 | static int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, |
529 | struct snd_ctl_elem_value *ucontrol) | ||
525 | { | 530 | { |
526 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); | 531 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
527 | int reg = kcontrol->private_value & 0xff; | 532 | int reg = kcontrol->private_value & 0xff; |
@@ -544,7 +549,8 @@ int snd_ac97_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value | |||
544 | return 0; | 549 | return 0; |
545 | } | 550 | } |
546 | 551 | ||
547 | int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 552 | static int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, |
553 | struct snd_ctl_elem_value *ucontrol) | ||
548 | { | 554 | { |
549 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); | 555 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
550 | int reg = kcontrol->private_value & 0xff; | 556 | int reg = kcontrol->private_value & 0xff; |
@@ -646,7 +652,7 @@ AC97_ENUM("Mic Select", std_enum[3]), | |||
646 | AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) | 652 | AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) |
647 | }; | 653 | }; |
648 | 654 | ||
649 | const struct snd_kcontrol_new snd_ac97_controls_3d[2] = { | 655 | static const struct snd_kcontrol_new snd_ac97_controls_3d[2] = { |
650 | AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0), | 656 | AC97_SINGLE("3D Control - Center", AC97_3D_CONTROL, 8, 15, 0), |
651 | AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0) | 657 | AC97_SINGLE("3D Control - Depth", AC97_3D_CONTROL, 0, 15, 0) |
652 | }; | 658 | }; |
@@ -817,7 +823,7 @@ static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
817 | return change; | 823 | return change; |
818 | } | 824 | } |
819 | 825 | ||
820 | const struct snd_kcontrol_new snd_ac97_controls_spdif[5] = { | 826 | static const struct snd_kcontrol_new snd_ac97_controls_spdif[5] = { |
821 | { | 827 | { |
822 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 828 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
823 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 829 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -1097,7 +1103,7 @@ static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned cha | |||
1097 | } | 1103 | } |
1098 | } | 1104 | } |
1099 | 1105 | ||
1100 | int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit) | 1106 | static int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit) |
1101 | { | 1107 | { |
1102 | unsigned short mask, val, orig, res; | 1108 | unsigned short mask, val, orig, res; |
1103 | 1109 | ||
@@ -1137,7 +1143,8 @@ static inline int printable(unsigned int x) | |||
1137 | return x; | 1143 | return x; |
1138 | } | 1144 | } |
1139 | 1145 | ||
1140 | struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97) | 1146 | static struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, |
1147 | struct snd_ac97 * ac97) | ||
1141 | { | 1148 | { |
1142 | struct snd_kcontrol_new template; | 1149 | struct snd_kcontrol_new template; |
1143 | memcpy(&template, _template, sizeof(template)); | 1150 | memcpy(&template, _template, sizeof(template)); |
@@ -2544,7 +2551,8 @@ static void set_ctl_name(char *dst, const char *src, const char *suffix) | |||
2544 | } | 2551 | } |
2545 | 2552 | ||
2546 | /* remove the control with the given name and optional suffix */ | 2553 | /* remove the control with the given name and optional suffix */ |
2547 | int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, const char *suffix) | 2554 | static int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, |
2555 | const char *suffix) | ||
2548 | { | 2556 | { |
2549 | struct snd_ctl_elem_id id; | 2557 | struct snd_ctl_elem_id id; |
2550 | memset(&id, 0, sizeof(id)); | 2558 | memset(&id, 0, sizeof(id)); |
@@ -2563,7 +2571,8 @@ static struct snd_kcontrol *ctl_find(struct snd_ac97 *ac97, const char *name, co | |||
2563 | } | 2571 | } |
2564 | 2572 | ||
2565 | /* rename the control with the given name and optional suffix */ | 2573 | /* rename the control with the given name and optional suffix */ |
2566 | int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, const char *suffix) | 2574 | static int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, |
2575 | const char *dst, const char *suffix) | ||
2567 | { | 2576 | { |
2568 | struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix); | 2577 | struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix); |
2569 | if (kctl) { | 2578 | if (kctl) { |
@@ -2574,14 +2583,16 @@ int snd_ac97_rename_ctl(struct snd_ac97 *ac97, const char *src, const char *dst, | |||
2574 | } | 2583 | } |
2575 | 2584 | ||
2576 | /* rename both Volume and Switch controls - don't check the return value */ | 2585 | /* rename both Volume and Switch controls - don't check the return value */ |
2577 | void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, const char *dst) | 2586 | static void snd_ac97_rename_vol_ctl(struct snd_ac97 *ac97, const char *src, |
2587 | const char *dst) | ||
2578 | { | 2588 | { |
2579 | snd_ac97_rename_ctl(ac97, src, dst, "Switch"); | 2589 | snd_ac97_rename_ctl(ac97, src, dst, "Switch"); |
2580 | snd_ac97_rename_ctl(ac97, src, dst, "Volume"); | 2590 | snd_ac97_rename_ctl(ac97, src, dst, "Volume"); |
2581 | } | 2591 | } |
2582 | 2592 | ||
2583 | /* swap controls */ | 2593 | /* swap controls */ |
2584 | int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, const char *s2, const char *suffix) | 2594 | static int snd_ac97_swap_ctl(struct snd_ac97 *ac97, const char *s1, |
2595 | const char *s2, const char *suffix) | ||
2585 | { | 2596 | { |
2586 | struct snd_kcontrol *kctl1, *kctl2; | 2597 | struct snd_kcontrol *kctl1, *kctl2; |
2587 | kctl1 = ctl_find(ac97, s1, suffix); | 2598 | kctl1 = ctl_find(ac97, s1, suffix); |