Index: firmware/target/arm/system-target.h =================================================================== --- firmware/target/arm/system-target.h (revision 20076) +++ firmware/target/arm/system-target.h (working copy) @@ -31,14 +31,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 20076) +++ 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 20076) +++ firmware/target/arm/ipod/button-clickwheel.c (working copy) @@ -175,7 +175,7 @@ v = (v<0) ? -v : v; /* undo signedness */ /* some velocity filtering to smooth things out */ - wheel_velocity = (31 * wheel_velocity + v) / 32; + wheel_velocity = (15 * wheel_velocity + v) / 16; /* limit to 24 bit */ wheel_velocity = (wheel_velocity>0xffffff) ? 0xffffff : wheel_velocity; @@ -225,6 +225,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/target/arm/sandisk/sansa-e200/button-e200.c =================================================================== --- firmware/target/arm/sandisk/sansa-e200/button-e200.c (revision 20076) +++ firmware/target/arm/sandisk/sansa-e200/button-e200.c (working copy) @@ -226,6 +226,9 @@ } last_wheel_usec = usec; + + /* be able to read wheel action via button_read_device() */ + int_btn |= BUTTON_SCROLL; } } Index: firmware/target/arm/sandisk/sansa-e200/button-target.h =================================================================== --- firmware/target/arm/sandisk/sansa-e200/button-target.h (revision 20076) +++ firmware/target/arm/sandisk/sansa-e200/button-target.h (working copy) @@ -48,6 +48,7 @@ #define BUTTON_SCROLL_BACK 0x00000080 #define BUTTON_SCROLL_FWD 0x00000100 +#define BUTTON_SCROLL 0x00000200 #define BUTTON_MAIN 0x00000fff Index: firmware/target/arm/system-pp502x.c =================================================================== --- firmware/target/arm/system-pp502x.c (revision 20076) +++ firmware/target/arm/system-pp502x.c (working copy) @@ -281,15 +281,19 @@ 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 = 0x8a121403; /* 80 MHz = (20/3 * 24MHz) / 2 */ + //PLL_CONTROL = 0x8a121e04; /* 90 MHz = (30/4 * 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 = 0x00000808; + //DEV_TIMING1 = 0x00000909; + 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; @@ -324,6 +328,7 @@ udelay(500); /* wait for relock */ #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) PLL_CONTROL = 0x8a220501; /* 30 MHz = (5/1 * 24MHz) / 4 */ + //PLL_CONTROL = 0x8a320501; /* 15 MHz = (5/1 * 24MHz) / 8 */ while (!(PLL_STATUS & 0x80000000)); /* wait for relock */ #endif scale_suspend_core(true); Index: firmware/drivers/button.c =================================================================== --- firmware/drivers/button.c (revision 20076) +++ firmware/drivers/button.c (working copy) @@ -95,6 +95,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 void button_tick(void) { static int count = 0; @@ -108,6 +126,10 @@ static bool skip_remote_release = false; #endif #endif +#ifdef HAVE_ADJUSTABLE_CPU_FREQ + static unsigned long last_button_usec; + unsigned long usec = USEC_TIMER; +#endif int diff; int btn; #ifdef HAVE_BUTTON_DATA @@ -141,6 +163,19 @@ } #endif +#ifdef HAVE_ADJUSTABLE_CPU_FREQ + /* Boost gui on button activity, unboost gui after timeout. */ + if (BUTTON_NONE != btn) + { + last_button_usec = usec; + gui_boost(true); + } + else if (TIME_AFTER(usec, last_button_usec + 1000000)) + { + gui_boost(false); + } +#endif + /* Find out if a key has been released */ diff = btn ^ lastbtn; if(diff && (btn & diff) == 0)