rk29_phone: headset hook key update
author邱建斌 <qjb@rock-chips.com>
Tue, 28 Jun 2011 06:50:19 +0000 (14:50 +0800)
committer邱建斌 <qjb@rock-chips.com>
Tue, 28 Jun 2011 06:50:19 +0000 (14:50 +0800)
drivers/headset_observe/rk_headset.c

index 5fcccad310908533b315e5bbb1cf298dcf0a43a7..22c32f17a7fddc121479513a180e9fd0ef189f0a 100755 (executable)
@@ -59,6 +59,7 @@
 #define disable 0
 
 extern int wm8994_set_status(void);
+
 /* headset private data */
 struct headset_priv {
        struct input_dev *input_dev;
@@ -182,7 +183,7 @@ static void headsetobserve_work(struct work_struct *work)
                //      enable_irq(headset_info->irq[HOOK]);
                        headset_info->cur_headset_status = BIT_HEADSET;
                        headset_change_irqtype(HEADSET,IRQF_TRIGGER_FALLING);//
-                       del_timer(&headset_info->headset_timer);//Æô¶¯¶¨Ê±Æ÷£¬µÈ´ýÇл»µ½¶ú»úͨ·
+                       del_timer(&headset_info->headset_timer);//Start the timer, wait for switch to the headphone channel
                        headset_info->headset_timer.expires = jiffies + 500;
                        add_timer(&headset_info->headset_timer);
                }
@@ -300,6 +301,7 @@ static void headset_timer_callback(unsigned long arg)
                DBG("Headset is out\n");
                goto out;
        }
+       #ifdef CONFIG_SND_SOC_WM8994
        if(wm8994_set_status() < 0)
        {
                DBG("wm8994 is not set on heatset channel\n");
@@ -307,7 +309,7 @@ static void headset_timer_callback(unsigned long arg)
                add_timer(&headset_info->headset_timer);        
                goto out;
        }
-       
+       #endif
        for(i=0; i<3; i++)
        {
                level = gpio_get_value(pdata->Hook_gpio);
@@ -326,7 +328,6 @@ static void headset_timer_callback(unsigned long arg)
                goto out;
        }
 
-//ÑÓ³ÙÒ»¶Îʱ¼ä¶ú»ú»¹ÊÇ°´ÏµĻ°£¬ÄÇôӦ¸ÃÊÇÎÞ°´¼ü¶ú»ú
        if(level == 0)
                headset->isMic= 0;//No microphone
        else if(level > 0)