modify the play key
author罗伟 <lw@rock-chips.com>
Tue, 8 Jun 2010 02:44:41 +0000 (02:44 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:35:24 +0000 (13:35 +0800)
drivers/input/keyboard/rk2818_adckey.c

index 44f30896348753e7a0652e884c92ecb594f983b4..4ef0c121682e803174f01790c373dd88889c53e7 100644 (file)
@@ -26,7 +26,7 @@
 #include <mach/gpio.h>
 #include <mach/adc.h>
 
-#if 0
+#if 1
 #define DBG(x...)   printk(x)
 #else
 #define DBG(x...)
@@ -188,26 +188,34 @@ static void rk28_adkeyscan_timer(unsigned long data)
        {
                if((++gPlayCount > 2) && (gFlagShortPlay == 0))
                {
-                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,1);
-                       input_sync(pRk28AdcKey->input_dev);
-                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,0);
-                       input_sync(pRk28AdcKey->input_dev);
                        gFlagShortPlay = 1;     
-                       DBG("Enter::%s,LINE=%d,KEY_PLAY_SHORT_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_SHORT_PRESS);
+                       
                }
                else if((++gPlayCount > 100) && (gFlagLongPlay == 0))
                {
-                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,1);
-                       input_sync(pRk28AdcKey->input_dev);
-                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,0);
-                       input_sync(pRk28AdcKey->input_dev);
                        gFlagLongPlay = 1;
-                       gPlayCount = 0;
-                       DBG("Enter::%s,LINE=%d,KEY_PLAY_LONG_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_LONG_PRESS);
+                       
                }
        }
        else
        {
+               if(gPlayCount > 100)
+               {
+                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,1);
+                       input_sync(pRk28AdcKey->input_dev);
+                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,0);
+                       input_sync(pRk28AdcKey->input_dev);
+                       DBG("Enter::%s,LINE=%d,KEY_PLAY_SHORT_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_SHORT_PRESS);
+               }       
+               else if (gPlayCount > 2)
+               {
+                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,1);
+                       input_sync(pRk28AdcKey->input_dev);
+                       input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,0);
+                       input_sync(pRk28AdcKey->input_dev);
+                       DBG("Enter::%s,LINE=%d,KEY_PLAY_LONG_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_LONG_PRESS);
+               }       
+               
                gFlagShortPlay = 0;     
                gFlagLongPlay = 0;
                gPlayCount = 0;