modify adckey for phone sdk
authorlyx <lyx@rock-chips.com>
Thu, 15 Jul 2010 10:05:09 +0000 (03:05 -0700)
committerlyx <lyx@rock-chips.com>
Thu, 15 Jul 2010 10:23:01 +0000 (03:23 -0700)
.config
drivers/input/keyboard/rk2818_adckey.c [changed mode: 0644->0755]

diff --git a/.config b/.config
index f2aac12189b0bf253a7dbe0219fc54b90b8acf2d..0dfb129b295531ae7e1be5ff64f7db4a5b51c04f 100644 (file)
--- 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
old mode 100644 (file)
new mode 100755 (executable)
index a921c52..3fe99d2
@@ -26,7 +26,7 @@
 #include <mach/gpio.h>
 #include <mach/adc.h>
 
-#if 0
+#if 0 
 #define DBG(x...)   printk(x)
 #else
 #define DBG(x...)
 
 
 #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)