Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.

My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.


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
Index: ascodec-as3525.c
===================================================================
--- ascodec-as3525.c  (revision 25301)
+++ ascodec-as3525.c  (working copy)
@@ -463,7 +463,11 @@

 void ascodec_wait_adc_finished(void)
 {
+#if CONFIG_CPU == AS3525
     wakeup_wait(&adc_wkup, TIMEOUT_BLOCK);
+#else
+    /* FIXME: Doesn't work yet on AS3525v2 */
+#endif
 }
 
 
Index: ascodec-target.h
===================================================================
--- ascodec-target.h  (revision 25301)
+++ ascodec-target.h  (working copy)
@@ -28,7 +28,8 @@
 #ifndef SIMULATOR
 
 #include "as3514.h"
-#include "kernel.h" /* for struct wakeup */
+#include "kernel.h"       /* for struct wakeup */
+#include "clock-target.h" /* for AS3525_I2C_PRESCALER */
 
 /*  Charge Pump and Power management Settings  */
 #define AS314_CP_DCDC3_SETTING    \
@@ -68,10 +69,12 @@
     struct ascodec_request *next;
 };
 
+static inline int ascodec_get_prescaler(void) {
+    return AS3525_I2C_PRESCALER;
+}
+
 void ascodec_init(void);
 
-void ascodec_init_late(void);
-
 int ascodec_write(unsigned int index, unsigned int value);
 
 int ascodec_read(unsigned int index);
Index: debug-as3525.c
===================================================================
--- debug-as3525.c  (revision 25301)
+++ debug-as3525.c  (working copy)
@@ -167,7 +167,7 @@
                     return 0;
             }
         case CLK_I2C:
-            return calc_freq(CLK_PCLK)/(I2C2_CPSR1<<8 | I2C2_CPSR0);
+            return calc_freq(CLK_PCLK)/ascodec_get_prescaler();
         case CLK_I2SI:
             switch((CGU_AUDIO>>12) & 3) {
                 case 0: