aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-11-06 16:43:53 -0500
committerTakashi Iwai <tiwai@suse.de>2008-12-10 11:14:39 -0500
commitc8974be5465b87414fa542cf9cca1a1ba21b8d60 (patch)
tree7d16731d9a99420bbadf77f2a05c4a90093601b5 /sound
parent57d4bf6d8e965404b82b105ae44ddf137bb7b8e6 (diff)
ALSA: cs5535audio: Use OLPC/Geode basic infrastructure
Use basic infrastructure code; geode_gpio* (rather than indexed i/o EC access), and do an OLPC machine check in olpc_quirk. [dilinger@debian.org: don't return failure in olpc_quirks if !OLPC] [dilinger@debian.org: drop the <B2 workarounds; those machines are EOL'd] Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Signed-off-by: Andres Salomon <dilinger@debian.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/cs5535audio/cs5535audio_olpc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
index 4b72d8662ec9..9073fb353f0e 100644
--- a/sound/pci/cs5535audio/cs5535audio_olpc.c
+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
@@ -1,9 +1,10 @@
1#include <linux/olpc.h>
2#include <sound/driver.h> 1#include <sound/driver.h>
3#include <sound/core.h> 2#include <sound/core.h>
4#include <sound/info.h> 3#include <sound/info.h>
5#include <sound/control.h> 4#include <sound/control.h>
6#include <sound/ac97_codec.h> 5#include <sound/ac97_codec.h>
6
7#include <asm/olpc.h>
7#include "cs5535audio.h" 8#include "cs5535audio.h"
8 9
9/* OLPC has an additional feature on top of regular AD1888 codec 10/* OLPC has an additional feature on top of regular AD1888 codec
@@ -81,13 +82,11 @@ static int snd_cs5535audio_ctl_put(struct snd_kcontrol *kcontrol,
81 if (err < 0) 82 if (err < 0)
82 snd_printk(KERN_ERR "Error updating AD_TEST2 %d\n", err); 83 snd_printk(KERN_ERR "Error updating AD_TEST2 %d\n", err);
83 84
85 /* B2 and newer writes directly to a GPIO pin */
84 if (value) 86 if (value)
85 err = write_ec_command(0x01); /* activate MIC_AC_OFF */ 87 geode_gpio_set(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL);
86 else 88 else
87 err = write_ec_command(0x02); /* deactivates MIC_AC_OFF */ 89 geode_gpio_clear(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL);
88
89 if (err < 0)
90 snd_printk(KERN_ERR "Error talking to EC %d\n", err);
91 90
92 cs5535au->ec_analog_input_mode = value; 91 cs5535au->ec_analog_input_mode = value;
93 92
@@ -106,6 +105,9 @@ static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata =
106 105
107int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97) 106int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
108{ 107{
108 if (!machine_is_olpc())
109 return 0;
110
109 /* setup callback for mixer control that does analog input mode */ 111 /* setup callback for mixer control that does analog input mode */
110 return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls, 112 return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls,
111 ac97->private_data)); 113 ac97->private_data));