From: 罗伟 Date: Tue, 8 Jun 2010 02:44:41 +0000 (+0000) Subject: modify the play key X-Git-Tag: firefly_0821_release~11408 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5fa2773c33c84cc36dc224aba1202e4ac1ce4178;p=firefly-linux-kernel-4.4.55.git modify the play key --- diff --git a/drivers/input/keyboard/rk2818_adckey.c b/drivers/input/keyboard/rk2818_adckey.c index 44f308963487..4ef0c121682e 100644 --- a/drivers/input/keyboard/rk2818_adckey.c +++ b/drivers/input/keyboard/rk2818_adckey.c @@ -26,7 +26,7 @@ #include #include -#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;