aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio/cs5535audio_olpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio_olpc.c')
-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));