From: lyx Date: Thu, 15 Jul 2010 10:05:09 +0000 (-0700) Subject: modify adckey for phone sdk X-Git-Tag: firefly_0821_release~11358^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ed467f836f50494acb1b90c946c152f89e262d33;p=firefly-linux-kernel-4.4.55.git modify adckey for phone sdk --- diff --git a/.config b/.config index f2aac12189b0..0dfb129b2955 100644 --- a/.config +++ b/.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.32.9 -# Thu Jul 15 09:09:48 2010 +# Thu Jul 15 03:02:03 2010 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -867,7 +867,7 @@ CONFIG_POWER_SUPPLY=y # CONFIG_BATTERY_BQ27x00 is not set # CONFIG_BATTERY_MAX17040 is not set CONFIG_BATTERY_RK2818=y -# CONFIG_PMIC_LP8725 is not set +CONFIG_PMIC_LP8725=y # CONFIG_HWMON is not set # CONFIG_THERMAL is not set # CONFIG_WATCHDOG is not set diff --git a/drivers/input/keyboard/rk2818_adckey.c b/drivers/input/keyboard/rk2818_adckey.c old mode 100644 new mode 100755 index a921c5264f20..3fe99d23fa57 --- a/drivers/input/keyboard/rk2818_adckey.c +++ b/drivers/input/keyboard/rk2818_adckey.c @@ -26,7 +26,7 @@ #include #include -#if 0 +#if 0 #define DBG(x...) printk(x) #else #define DBG(x...) @@ -50,7 +50,11 @@ #define Valuedrift 50 +#ifndef CONFIG_MACH_RK2818PHONE #define ADEmpty 1000 +#else +#define ADEmpty 900 +#endif #define ADInvalid 20 #define ADKEYNUM 10 @@ -74,6 +78,7 @@ typedef struct tagADC_keyst unsigned int adc_keycode; }ADC_keyst,*pADC_keyst; +#ifndef CONFIG_MACH_RK2818PHONE // adc ---> key static ADC_keyst gAdcValueTab[] = { @@ -85,6 +90,18 @@ static ADC_keyst gAdcValueTab[] = {899, AD2KEY6}, {ADEmpty,0} }; +#else +static ADC_keyst gAdcValueTab[] = +{ + {95, AD2KEY1}, + {192, AD2KEY2}, + {280, AD2KEY3}, + {376, AD2KEY4}, + {467, AD2KEY5}, + {560, AD2KEY6}, + {ADEmpty,0} +}; +#endif //key code tab static unsigned char gInitKeyCode[ADKEYNUM] = @@ -240,10 +257,13 @@ static void rk28_adkeyscan_timer(unsigned long data) //rk28_read_adc(pRk28AdcKey); adcvalue = gAdcValue[ADKEYCH]; + DBG("=========== adcvalue=0x%x ===========\n",adcvalue); + if((adcvalue > ADEmpty) || (adcvalue < ADInvalid)) { - if(gLastCode == 0) - return; + if(gLastCode == 0) { + return; + } else { if(gLastCode == KEYMENU) @@ -268,7 +288,7 @@ static void rk28_adkeyscan_timer(unsigned long data) } } - DBG("adcvalue=0x%x\n",adcvalue); + //DBG("adcvalue=0x%x\n",adcvalue); code=rk28_get_keycode(adcvalue,gAdcValueTab); if(code)