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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Index: firmware/drivers/audio/wm8975.c
===================================================================
--- firmware/drivers/audio/wm8975.c  (revision 29466)
+++ firmware/drivers/audio/wm8975.c  (working copy)
@@ -150,8 +150,8 @@
     wmcodec_write(SAMPCTRL, WM8975_44100HZ);
 #endif

-    wmcodec_write(LOUTMIX1, LOUTMIX1_LD2LO | LOUTMIX1_LI2LOVOL(5));
-    wmcodec_write(ROUTMIX2, ROUTMIX2_RD2RO | ROUTMIX2_RI2ROVOL(5));
+    wm8975_write(LOUTMIX1, LOUTMIX1_LD2LO | LOUTMIX1_LI2LOVOL(5));
+    wm8975_write(ROUTMIX2, ROUTMIX2_RD2RO | ROUTMIX2_RI2ROVOL(5));

     wm8975_write(PWRMGMT1, wm8975_regs[PWRMGMT1]);
     wm8975_write(PWRMGMT2, wm8975_regs[PWRMGMT2]);
@@ -195,14 +195,14 @@
     wmcodec_write(LOUT1VOL, LOUT1VOL_LO1ZC | IPOD_PCM_LEVEL);
     wmcodec_write(ROUT1VOL, ROUT1VOL_RO1VU | ROUT1VOL_RO1ZC | IPOD_PCM_LEVEL);

-    wmcodec_write(LOUTMIX1, LOUTMIX1_LD2LO| LOUTMIX1_LI2LOVOL(5));
-    wmcodec_write(LOUTMIX2, LOUTMIX2_RI2LOVOL(5));
+    wm8975_write(LOUTMIX1, LOUTMIX1_LD2LO| LOUTMIX1_LI2LOVOL(5));
+    wm8975_write(LOUTMIX2, LOUTMIX2_RI2LOVOL(5));

-    wmcodec_write(ROUTMIX1, ROUTMIX1_LI2ROVOL(5));
-    wmcodec_write(ROUTMIX2, ROUTMIX2_RD2RO| ROUTMIX2_RI2ROVOL(5));
+    wm8975_write(ROUTMIX1, ROUTMIX1_LI2ROVOL(5));
+    wm8975_write(ROUTMIX2, ROUTMIX2_RD2RO| ROUTMIX2_RI2ROVOL(5));

-    wmcodec_write(MOUTMIX1, 0);
-    wmcodec_write(MOUTMIX2, 0);
+    wm8975_write(MOUTMIX1, 0);
+    wm8975_write(MOUTMIX2, 0);
 }

 void audiohw_postinit(void)
@@ -361,12 +361,12 @@
     if (enable) {
         /* set volume to 0 dB */
         wm8975_regs[LOUTMIX1] &= ~LOUTMIX1_LI2LOVOL_MASK;
-        wm8975_regs[LOUTMIX1] |= LOUTMIX1_LI2LOVOL(2);
+        wm8975_regs[LOUTMIX1] |=  LOUTMIX1_LI2LOVOL(2);
         wm8975_regs[ROUTMIX2] &= ~ROUTMIX2_RI2ROVOL_MASK;
-        wm8975_regs[ROUTMIX2] |= ROUTMIX2_RI2ROVOL(2);
+        wm8975_regs[ROUTMIX2] |=  ROUTMIX2_RI2ROVOL(2);
         /* set mux to line input */
-        wm8975_write_and(LOUTMIX1, ~7);
-        wm8975_write_and(ROUTMIX1, ~7);
+        wm8975_write_and(LOUTMIX1, ~LOUTMIX1_RMIXSEL_MASK);
+        wm8975_write_and(ROUTMIX1, ~ROUTMIX1_RMIXSEL_MASK);
         /* enable bypass */
         wm8975_write_or(LOUTMIX1, LOUTMIX1_LI2LO);
         wm8975_write_or(ROUTMIX2, ROUTMIX2_RI2RO);
Index: firmware/export/wm8975.h
===================================================================
--- firmware/export/wm8975.h  (revision 29466)
+++ firmware/export/wm8975.h  (working copy)
@@ -236,6 +236,7 @@
 #define LOUTMIX1_LMIXSEL_LIN3   (2 << 0)
 #define LOUTMIX1_LMIXSEL_LADCIN (3 << 0)
 #define LOUTMIX1_LMIXSEL_DIFF   (4 << 0)
+#define LOUTMIX1_LMIXSEL_MASK   (7 << 0)
 #define LOUTMIX1_LI2LOVOL(x)    ((x & 7) << 4)
 #define LOUTMIX1_LI2LOVOL_MASK  (7 << 4)
 #define LOUTMIX1_LI2LO          (1 << 7)
@@ -253,6 +254,7 @@
 #define ROUTMIX1_RMIXSEL_RIN3   (2 << 0)
 #define ROUTMIX1_RMIXSEL_RADCIN (3 << 0)
 #define ROUTMIX1_RMIXSEL_DIFF   (4 << 0)
+#define ROUTMIX1_RMIXSEL_MASK   (7 << 0)
 #define ROUTMIX1_LI2ROVOL(x)    ((x & 7) << 4)
 #define ROUTMIX1_LI2ROVOL_MASK  (7 << 4)
 #define ROUTMIX1_LI2RO          (1 << 7)