Index: firmware/target/arm/ipod/button-1g-3g.c =================================================================== --- firmware/target/arm/ipod/button-1g-3g.c (revision 16682) +++ firmware/target/arm/ipod/button-1g-3g.c (working copy) @@ -41,15 +41,9 @@ #include "powermgmt.h" #include "hwcompat.h" -static int int_btn = BUTTON_NONE; -#ifdef IPOD_1G2G -/* The 1st Gen wheel draws ~12mA when enabled permanently. Therefore - * we only enable it for a very short time to check for changes every - * tick, and only keep it enabled if there is activity. */ -#define WHEEL_TIMEOUT (HZ/4) -static int wheel_timeout = 0; -#endif +int int_btn = BUTTON_NONE; + /* iPod 3G and mini 1G, mini 2G uses iPod 4G code */ void handle_scroll_wheel(int new_scroll, int was_hold, int reverse) { @@ -63,11 +57,9 @@ {1, 0, 0, -1}, {0, -1, 1, 0} }; - -#ifdef IPOD_1G2G - wheel_timeout = WHEEL_TIMEOUT; -#endif + + if ( prev_scroll == -1 ) { prev_scroll = new_scroll; } @@ -117,7 +109,7 @@ unsigned char source, state; static bool was_hold = false; int btn = BUTTON_NONE; - + #ifdef IPOD_3G /* The following delay was 250 in the ipodlinux source, * but 50 seems to work fine. 250 causes the wheel to stop @@ -127,10 +119,10 @@ /* get source of interupts */ source = GPIOA_INT_STAT; - + /* get current keypad status */ state = GPIOA_INPUT_VAL; - + /* toggle interrupt level */ GPIOA_INT_LEV = ~state; @@ -218,30 +210,7 @@ { static bool hold_button = false; bool hold_button_old; -#ifdef IPOD_1G2G - static unsigned char last_wheel_value = 0; - unsigned char wheel_value; - if ((IPOD_HW_REVISION >> 16) == 1) - { - if (!hold_button && (wheel_timeout == 0)) - { - GPIOB_OUTPUT_VAL |= 0x01; /* enable wheel */ - udelay(50); /* let the voltage settle */ - wheel_value = GPIOA_INPUT_VAL >> 6; - if (wheel_value != last_wheel_value) - { - last_wheel_value = wheel_value; - wheel_timeout = WHEEL_TIMEOUT; /* keep wheel enabled */ - } - } - if (wheel_timeout) - wheel_timeout--; - else - GPIOB_OUTPUT_VAL &= ~0x01; /* disable wheel */ - } -#endif - /* normal buttons */ hold_button_old = hold_button; hold_button = button_hold();