diff options
author | Andres Salomon <dilinger@queued.net> | 2008-11-06 16:49:46 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-12-10 11:14:43 -0500 |
commit | 466ae3055be8665525a5613456fcb387ffef4cb7 (patch) | |
tree | d87472c899eac2618d1b10c2b0fc6bec7db26ccf /sound/pci/cs5535audio | |
parent | d6276b78028dfab944dd4a58124aefcc9aa580da (diff) |
ALSA: cs5535audio: rename OLPC's analog input control && drop AD1888's HPF
Previously, we had two separate controls; there's no need to have AD1888's
HPF control, so drop it if we're on an OLPC machine. Also, as per Arjun's
request, rename OLPC's Analog Input Switch control to "DC Mode Enable".
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs5535audio')
-rw-r--r-- | sound/pci/cs5535audio/cs5535audio_olpc.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c index 597395e6e358..6c0c0dbeb218 100644 --- a/sound/pci/cs5535audio/cs5535audio_olpc.c +++ b/sound/pci/cs5535audio/cs5535audio_olpc.c | |||
@@ -31,8 +31,8 @@ void olpc_analog_input(struct snd_ac97 *ac97, int on) | |||
31 | geode_gpio_clear(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL); | 31 | geode_gpio_clear(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL); |
32 | } | 32 | } |
33 | 33 | ||
34 | static int snd_cs5535audio_ctl_info(struct snd_kcontrol *kcontrol, | 34 | static int olpc_dc_info(struct snd_kcontrol *kctl, |
35 | struct snd_ctl_elem_info *uinfo) | 35 | struct snd_ctl_elem_info *uinfo) |
36 | { | 36 | { |
37 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 37 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
38 | uinfo->count = 1; | 38 | uinfo->count = 1; |
@@ -41,35 +41,33 @@ static int snd_cs5535audio_ctl_info(struct snd_kcontrol *kcontrol, | |||
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | static int snd_cs5535audio_ctl_get(struct snd_kcontrol *kcontrol, | 44 | static int olpc_dc_get(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v) |
45 | struct snd_ctl_elem_value *ucontrol) | ||
46 | { | 45 | { |
47 | struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol); | 46 | struct cs5535audio *cs5535au = snd_kcontrol_chip(kctl); |
48 | u8 val; | 47 | u8 val; |
49 | 48 | ||
50 | val = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2); | 49 | val = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2); |
51 | val >>= AC97_AD_HPFD_SHIFT; | 50 | val >>= AC97_AD_HPFD_SHIFT; |
52 | ucontrol->value.integer.value[0] = val & 0x1; | 51 | v->value.integer.value[0] = val & 0x1; |
53 | 52 | ||
54 | return 0; | 53 | return 0; |
55 | } | 54 | } |
56 | 55 | ||
57 | static int snd_cs5535audio_ctl_put(struct snd_kcontrol *kcontrol, | 56 | static int olpc_dc_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v) |
58 | struct snd_ctl_elem_value *ucontrol) | ||
59 | { | 57 | { |
60 | struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol); | 58 | struct cs5535audio *cs5535au = snd_kcontrol_chip(kctl); |
61 | 59 | ||
62 | olpc_analog_input(cs5535au->ac97, ucontrol->value.integer.value[0]); | 60 | olpc_analog_input(cs5535au->ac97, v->value.integer.value[0]); |
63 | return 1; | 61 | return 1; |
64 | } | 62 | } |
65 | 63 | ||
66 | static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata = | 64 | static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata = |
67 | { | 65 | { |
68 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 66 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
69 | .name = "Analog Input Switch", | 67 | .name = "DC Mode Enable", |
70 | .info = snd_cs5535audio_ctl_info, | 68 | .info = olpc_dc_info, |
71 | .get = snd_cs5535audio_ctl_get, | 69 | .get = olpc_dc_get, |
72 | .put = snd_cs5535audio_ctl_put, | 70 | .put = olpc_dc_put, |
73 | .private_value = 0 | 71 | .private_value = 0 |
74 | }; | 72 | }; |
75 | 73 | ||
@@ -86,10 +84,18 @@ void __devinit olpc_prequirks(struct snd_card *card, | |||
86 | 84 | ||
87 | int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97) | 85 | int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97) |
88 | { | 86 | { |
87 | struct snd_ctl_elem_id elem; | ||
88 | |||
89 | if (!machine_is_olpc()) | 89 | if (!machine_is_olpc()) |
90 | return 0; | 90 | return 0; |
91 | 91 | ||
92 | /* setup callback for mixer control that does analog input mode */ | 92 | /* drop the original AD1888 HPF control */ |
93 | memset(&elem, 0, sizeof(elem)); | ||
94 | elem.iface = SNDRV_CTL_ELEM_IFACE_MIXER; | ||
95 | strncpy(elem.name, "High Pass Filter Enable", sizeof(elem.name)); | ||
96 | snd_ctl_remove_id(card, &elem); | ||
97 | |||
98 | /* add the override for OLPC's HPF */ | ||
93 | return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls, | 99 | return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls, |
94 | ac97->private_data)); | 100 | ac97->private_data)); |
95 | } | 101 | } |