forked from davidjo/snd_hda_macbookpro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch_patch_cs8409.c.diff
46 lines (42 loc) · 1.52 KB
/
patch_patch_cs8409.c.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/kernel_sources/patch_cs8409.c b/patch_cirrus/patch_cs8409.c
index aff2b5a..7e9c07c 100644
--- a/kernel_sources/patch_cs8409.c
+++ b/patch_cirrus/patch_cs8409.c
@@ -1270,6 +1270,8 @@ void dolphin_fixups(struct hda_codec *codec, const struct hda_fixup *fix, int ac
}
}
+static int patch_cs8409_apple(struct hda_codec *codec);
+
static int patch_cs8409(struct hda_codec *codec)
{
int err;
@@ -1277,8 +1279,19 @@ static int patch_cs8409(struct hda_codec *codec)
if (!cs8409_alloc_spec(codec))
return -ENOMEM;
+ printk("snd_hda_intel: Primary patch_cs8409\n");
+
snd_hda_pick_fixup(codec, cs8409_models, cs8409_fixup_tbl, cs8409_fixups);
+ // this seems the easiest way to separate and jump into the code for handling Apple machines using the 8409
+ // note now freeing the just allocated spec - this undos the delayed work as not using mutex yet
+ if (codec->fixup_id == HDA_FIXUP_ID_NOT_SET) {
+ printk("snd_hda_intel: Primary patch_cs8409 NOT FOUND trying APPLE\n");
+ cs8409_free(codec);
+ err = patch_cs8409_apple(codec);
+ return err;
+ }
+
codec_dbg(codec, "Picked ID=%d, VID=%08x, DEV=%08x\n", codec->fixup_id,
codec->bus->pci->subsystem_vendor,
codec->bus->pci->subsystem_device);
@@ -1295,6 +1308,12 @@ static int patch_cs8409(struct hda_codec *codec)
return 0;
}
+
+// for the moment split the new code into an include file
+
+#include "patch_cirrus_apple.h"
+
+
static const struct hda_device_id snd_hda_id_cs8409[] = {
HDA_CODEC_ENTRY(0x10138409, "CS8409", patch_cs8409),
{} /* terminator */