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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Index: firmware/target/arm/system-pp502x.c
===================================================================
--- firmware/target/arm/system-pp502x.c  (revision 28606)
+++ firmware/target/arm/system-pp502x.c  (working copy)
@@ -314,15 +314,15 @@
         PLL_CONTROL   = 0x8a020a03; /* repeat setup */
         udelay(500);                /* wait for relock */
 #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
-        PLL_CONTROL   = 0x8a121403; /*  80 MHz = (20/3 * 24MHz) / 2 */
+        PLL_CONTROL   = 0x8a021906; /* 100 MHz = (25/6 * 24MHz) / 1 */
         while (!(PLL_STATUS & 0x80000000)); /* wait for relock */
 #endif
         scale_suspend_core(true);
-        DEV_TIMING1   = 0x00000808;
+        DEV_TIMING1   = 0x00000a0a;
         CLOCK_SOURCE  = 0x20007777; /* source #1, #2, #3, #4: PLL (#2 active) */
         scale_suspend_core(false);
         break;
-#if 0 /******** CPUFREQ_NORMAL = 24MHz without PLL ********/
+#if 1 /******** CPUFREQ_NORMAL = 24MHz without PLL ********/
       case CPUFREQ_NORMAL:
         cpu_frequency =  CPUFREQ_NORMAL;
         PLL_CONTROL  |=  0x08000000;
Index: firmware/target/arm/system-target.h
===================================================================
--- firmware/target/arm/system-target.h  (revision 28606)
+++ firmware/target/arm/system-target.h  (working copy)
@@ -32,14 +32,14 @@
 #if CONFIG_CPU == PP5002
 #define CPUFREQ_SLEEP      32768
 #define CPUFREQ_DEFAULT 24000000
-#define CPUFREQ_NORMAL  30000000
+#define CPUFREQ_NORMAL  24000000
 #define CPUFREQ_MAX     80000000

 #else /* PP5022, PP5024 */
 #define CPUFREQ_SLEEP      32768
 #define CPUFREQ_DEFAULT 24000000
-#define CPUFREQ_NORMAL  30000000
-#define CPUFREQ_MAX     80000000
+#define CPUFREQ_NORMAL  24000000
+#define CPUFREQ_MAX    100000000
 #endif

 #define inl(a) (*(volatile unsigned long *) (a))
Index: firmware/target/arm/ipod/button-target.h
===================================================================
--- firmware/target/arm/ipod/button-target.h  (revision 28606)
+++ firmware/target/arm/ipod/button-target.h  (working copy)
@@ -43,12 +43,13 @@
 #define BUTTON_RIGHT        0x00000008
 #define BUTTON_SCROLL_FWD   0x00000010
 #define BUTTON_SCROLL_BACK  0x00000020
+#define BUTTON_SCROLL       0x00000040

-#define BUTTON_PLAY         0x00000040
+#define BUTTON_PLAY         0x00000080

 #define BUTTON_MAIN (BUTTON_SELECT|BUTTON_MENU\
                 |BUTTON_LEFT|BUTTON_RIGHT|BUTTON_SCROLL_FWD\
-                |BUTTON_SCROLL_BACK|BUTTON_PLAY)
+                |BUTTON_SCROLL_BACK|BUTTON_SCROLL|BUTTON_PLAY)

     /* Remote control's buttons */
 #ifdef IPOD_ACCESSORY_PROTOCOL
Index: firmware/target/arm/ipod/button-clickwheel.c
===================================================================
--- firmware/target/arm/ipod/button-clickwheel.c  (revision 28606)
+++ firmware/target/arm/ipod/button-clickwheel.c  (working copy)
@@ -39,6 +39,7 @@
 #include "serial.h"
 #include "power.h"
 #include "powermgmt.h"
+#include "button-target.h"
 #if defined(IPOD_NANO2G)
 #include "pmu-target.h"
 #endif
@@ -249,6 +250,9 @@
                         }
                         last_wheel_usec = usec;
                         old_wheel_value = new_wheel_value;
+                        
+                        /* be able to read wheel action via button_read_device() */  
+                        btn |= BUTTON_SCROLL;
                     }
                 }
                 else
Index: firmware/drivers/button.c
===================================================================
--- firmware/drivers/button.c  (revision 28606)
+++ firmware/drivers/button.c  (working copy)
@@ -109,6 +109,24 @@
 }
 #endif

+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+static void gui_boost(bool state)
+{
+    static bool boosted = false;
+    
+    if (state && !boosted)
+    {
+        cpu_boost(true);
+        boosted = true;
+    }
+    else if (!state && boosted)
+    {
+        cpu_boost(false);
+        boosted = false;
+    }
+}
+#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
+
 static bool button_try_post(int button, int data)
 {
 #ifdef HAVE_TOUCHSCREEN
@@ -151,6 +169,9 @@
     static bool skip_remote_release = false;
 #endif
 #endif
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+    static long last_button_tick;
+#endif
     int diff;
     int btn;
 #ifdef HAVE_BUTTON_DATA
@@ -181,6 +202,19 @@
     }
 #endif

+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+    /* Boost gui on button activity, unboost gui after timeout (1 sec). */
+    if (BUTTON_NONE != btn)
+    {
+        last_button_tick = current_tick;
+        gui_boost(true);
+    }
+    else if (TIME_AFTER(current_tick, last_button_tick + HZ))
+    {
+        gui_boost(false);
+    }
+#endif
+
     /* Find out if a key has been released */
     diff = btn ^ lastbtn;
     if(diff && (btn & diff) == 0)