aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/cs5535audio')
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c3
-rw-r--r--sound/pci/cs5535audio/cs5535audio.h11
-rw-r--r--sound/pci/cs5535audio/cs5535audio_olpc.c11
3 files changed, 23 insertions, 2 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 50333bb9242c..130f10a8d524 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -164,6 +164,9 @@ static int __devinit snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
164 ac97.private_data = cs5535au; 164 ac97.private_data = cs5535au;
165 ac97.pci = cs5535au->pci; 165 ac97.pci = cs5535au->pci;
166 166
167 /* set any OLPC-specific scaps */
168 olpc_prequirks(card, &ac97);
169
167 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) { 170 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) {
168 snd_printk(KERN_ERR "mixer failed\n"); 171 snd_printk(KERN_ERR "mixer failed\n");
169 return err; 172 return err;
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h
index adcb213eb276..93602cf2858a 100644
--- a/sound/pci/cs5535audio/cs5535audio.h
+++ b/sound/pci/cs5535audio/cs5535audio.h
@@ -103,9 +103,16 @@ int snd_cs5535audio_resume(struct pci_dev *pci);
103#endif 103#endif
104 104
105#ifdef CONFIG_OLPC 105#ifdef CONFIG_OLPC
106int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97); 106void __devinit olpc_prequirks(struct snd_card *card,
107 struct snd_ac97_template *ac97);
108int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97);
107#else 109#else
108#define olpc_quirks(arg, arg2) (0) 110static inline void olpc_prequirks(struct snd_card *card,
111 struct snd_ac97_template *ac97) { }
112static inline int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
113{
114 return 0;
115}
109#endif 116#endif
110 117
111int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio); 118int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
index 9073fb353f0e..ff7b68ba6179 100644
--- a/sound/pci/cs5535audio/cs5535audio_olpc.c
+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
@@ -103,6 +103,17 @@ static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata =
103 .private_value = 0 103 .private_value = 0
104}; 104};
105 105
106void __devinit olpc_prequirks(struct snd_card *card,
107 struct snd_ac97_template *ac97)
108{
109 if (!machine_is_olpc())
110 return;
111
112 /* invert EAPD if on an OLPC B3 or higher */
113 if (olpc_board_at_least(olpc_board_pre(0xb3)))
114 ac97->scaps |= AC97_SCAP_INV_EAPD;
115}
116
106int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97) 117int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
107{ 118{
108 if (!machine_is_olpc()) 119 if (!machine_is_olpc())