ALSA: cs5535 - Make OLPC-stuff depending on MGEODE_LX
[pandora-kernel.git] / sound / pci / cs5535audio / cs5535audio.h
index adcb213..7a298ac 100644 (file)
@@ -92,9 +92,6 @@ struct cs5535audio {
        struct snd_pcm_substream *playback_substream;
        struct snd_pcm_substream *capture_substream;
        struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
-#ifdef CONFIG_OLPC
-       int ec_analog_input_mode;
-#endif
 };
 
 #ifdef CONFIG_PM
@@ -102,10 +99,39 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
 int snd_cs5535audio_resume(struct pci_dev *pci);
 #endif
 
-#ifdef CONFIG_OLPC
-int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97);
+#if defined(CONFIG_OLPC) && defined(CONFIG_MGEODE_LX)
+void __devinit olpc_prequirks(struct snd_card *card,
+               struct snd_ac97_template *ac97);
+int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97);
+void olpc_analog_input(struct snd_ac97 *ac97, int on);
+void olpc_mic_bias(struct snd_ac97 *ac97, int on);
+
+static inline void olpc_capture_open(struct snd_ac97 *ac97)
+{
+       /* default to Analog Input off */
+       olpc_analog_input(ac97, 0);
+       /* enable MIC Bias for recording */
+       olpc_mic_bias(ac97, 1);
+}
+
+static inline void olpc_capture_close(struct snd_ac97 *ac97)
+{
+       /* disable Analog Input */
+       olpc_analog_input(ac97, 0);
+       /* disable the MIC Bias (so the recording LED turns off) */
+       olpc_mic_bias(ac97, 0);
+}
 #else
-#define olpc_quirks(arg, arg2) (0)
+static inline void olpc_prequirks(struct snd_card *card,
+               struct snd_ac97_template *ac97) { }
+static inline int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
+{
+       return 0;
+}
+static inline void olpc_analog_input(struct snd_ac97 *ac97, int on) { }
+static inline void olpc_mic_bias(struct snd_ac97 *ac97, int on) { }
+static inline void olpc_capture_open(struct snd_ac97 *ac97) { }
+static inline void olpc_capture_close(struct snd_ac97 *ac97) { }
 #endif
 
 int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);