headset : Add headphones debounce
[firefly-linux-kernel-4.4.55.git] / drivers / headset_observe / rk_headset_irq_hook_adc.c
1 /* arch/arm/mach-rockchip/rk28_headset.c
2  *
3  * Copyright (C) 2009 Rockchip Corporation.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 #include <linux/module.h>
17 #include <linux/sysdev.h>
18 #include <linux/device.h>
19 #include <linux/fs.h>
20 #include <linux/interrupt.h>
21 #include <linux/workqueue.h>
22 #include <linux/irq.h>
23 #include <linux/delay.h>
24 #include <linux/types.h>
25 #include <linux/input.h>
26 #include <linux/platform_device.h>
27 #include <linux/mutex.h>
28 #include <linux/errno.h>
29 #include <linux/err.h>
30 #include <linux/hrtimer.h>
31 #include <linux/switch.h>
32 #include <linux/input.h>
33 #include <linux/debugfs.h>
34 #include <linux/wakelock.h>
35 #include <asm/gpio.h>
36 #include <asm/atomic.h>
37 #include <asm/mach-types.h>
38 #include "rk_headset.h"
39 #include <linux/earlysuspend.h>
40 #include <linux/gpio.h>
41 #include <mach/board.h>
42 #include <linux/slab.h>
43 #include <linux/adc.h>
44 #include <linux/wakelock.h>
45
46 /* Debug */
47 #if 1
48 #define DBG(x...) printk(x)
49 #else
50 #define DBG(x...) do { } while (0)
51 #endif
52
53 #define HOOK_ADC_SAMPLE_TIME    50
54 #define HOOK_LEVEL_HIGH                 410             //1V*1024/2.5
55 #define HOOK_LEVEL_LOW                  204             //0.5V*1024/2.5
56 #define HOOK_DEFAULT_VAL                1024    
57
58 #define BIT_HEADSET             (1 << 0)
59 #define BIT_HEADSET_NO_MIC      (1 << 1)
60
61 #define HEADSET 0
62 #define HOOK 1
63
64 #define HEADSET_IN 1
65 #define HEADSET_OUT 0
66 #define HOOK_DOWN 1
67 #define HOOK_UP 0
68 #define enable 1
69 #define disable 0
70
71 #define HEADSET_TIMER 1
72 #define HOOK_TIMER 2
73
74 #define WAIT 2
75 #define BUSY 1
76 #define IDLE 0
77
78 #ifdef CONFIG_SND_SOC_WM8994
79 extern int wm8994_headset_mic_detect(bool headset_status);
80 #endif
81
82 #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
83 extern int rt3261_headset_mic_detect(int jack_insert);
84 #endif
85
86 /* headset private data */
87 struct headset_priv {
88         struct input_dev *input_dev;
89         struct rk_headset_pdata *pdata;
90         unsigned int headset_status:1;
91         unsigned int hook_status:1;
92         int isMic;
93         unsigned int heatset_irq_working;// headset interrupt working will not check hook key   
94         int cur_headset_status; 
95         
96         unsigned int irq[2];
97         unsigned int irq_type[2];
98         struct delayed_work h_delayed_work[2];
99         struct switch_dev sdev;
100         struct mutex mutex_lock[2];     
101         struct timer_list headset_timer;
102         unsigned char *keycodes;
103         struct adc_client *client;
104         struct timer_list hook_timer;
105         unsigned int hook_time;//ms
106         struct wake_lock headset_on_wake;
107 };
108 static struct headset_priv *headset_info;
109
110 int Headset_isMic(void)
111 {
112         return headset_info->isMic;
113 }
114 EXPORT_SYMBOL_GPL(Headset_isMic);
115
116 //1
117 static irqreturn_t headset_interrupt(int irq, void *dev_id)
118 {
119         struct rk_headset_pdata *pdata = headset_info->pdata;
120         static unsigned int old_status = 0;
121         int i,level = 0;        
122         int adc_value = 0;
123         wake_lock(&headset_info->headset_on_wake);
124         if(headset_info->heatset_irq_working == BUSY || headset_info->heatset_irq_working == WAIT)
125                 return IRQ_HANDLED;
126         DBG("In the headset_interrupt for read headset level  wake_lock headset_on_wake\n");            
127         headset_info->heatset_irq_working = BUSY;
128         msleep(150);
129         for(i=0; i<3; i++)
130         {
131                 level = gpio_get_value(pdata->Headset_gpio);
132                 if(level < 0)
133                 {
134                         printk("%s:get pin level again,pin=%d,i=%d\n",__FUNCTION__,pdata->Headset_gpio,i);
135                         msleep(1);
136                         continue;
137                 }
138                 else
139                 break;
140         }
141         if(level < 0)
142         {
143                 printk("%s:get pin level  err!\n",__FUNCTION__);
144                 goto out;
145         }
146
147         old_status = headset_info->headset_status;
148         switch(pdata->headset_in_type)
149         {
150         case HEADSET_IN_HIGH:
151                 if(level > 0)
152                         headset_info->headset_status = HEADSET_IN;
153                 else if(level == 0)
154                         headset_info->headset_status = HEADSET_OUT;     
155                 break;
156         case HEADSET_IN_LOW:
157                 if(level == 0)
158                         headset_info->headset_status = HEADSET_IN;
159                 else if(level > 0)
160                         headset_info->headset_status = HEADSET_OUT;             
161                 break;                  
162         default:
163                 DBG("---- ERROR: on headset headset_in_type error -----\n");
164                 break;                  
165         }
166         if(old_status == headset_info->headset_status)
167         {
168                 DBG("Read Headset IO level old status == now status\n");
169                 goto out;
170         }
171
172         DBG("(headset in is %s)headset status is %s\n",
173                 pdata->headset_in_type?"high level":"low level",
174                 headset_info->headset_status?"in":"out");
175         if(headset_info->headset_status == HEADSET_IN)
176         {
177                 #if 0
178                 while(1)
179                 {
180                         if(adc_sync_read(headset_info->client) > HOOK_DEFAULT_VAL
181                          || adc_sync_read(headset_info->client) < 0)
182                         {
183                                 printk("headset is showly inside\n");
184                         }
185                         else
186                                 break;
187                         msleep(50);
188                         
189                         if(pdata->headset_in_type == HEADSET_IN_HIGH)
190                                 old_status = headset_info->headset_status = gpio_get_value(pdata->Headset_gpio)?HEADSET_IN:HEADSET_OUT;
191                         else
192                                 old_status = headset_info->headset_status = gpio_get_value(pdata->Headset_gpio)?HEADSET_OUT:HEADSET_IN;
193                         if(headset_info->headset_status == HEADSET_OUT)
194                                 goto out1;
195                         msleep(5);      
196                 }
197                 #endif
198                 if(pdata->Hook_adc_chn>=0 && 3>=pdata->Hook_adc_chn)
199                 {
200                 // wait for find Hook key
201                         //#ifdef CONFIG_SND_SOC_RT5625
202                         CHECK_AGAIN:
203                         //headset_info->isMic = rt5625_headset_mic_detect(true);
204                         #ifdef CONFIG_SND_SOC_WM8994
205                         wm8994_headset_mic_detect(true);
206                         #endif
207                         #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
208                         rt3261_headset_mic_detect(true);
209                         #endif
210                         //mdelay(400);
211                         adc_value = adc_sync_read(headset_info->client);
212                         if(adc_value >= 0 && adc_value < HOOK_LEVEL_LOW)
213                         {
214                                 headset_info->isMic= 0;//No microphone
215                                 #ifdef CONFIG_SND_SOC_WM8994
216                                 wm8994_headset_mic_detect(false);
217                                 #endif
218                                 #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
219                                 rt3261_headset_mic_detect(false);
220                                 #endif  
221                         }       
222                         else if(adc_value >= HOOK_LEVEL_HIGH)
223                                 headset_info->isMic = 1;//have mic
224
225                         if(headset_info->isMic < 0)     
226                         {
227                                 printk("codec is error\n");
228                                 headset_info->heatset_irq_working = WAIT;
229                                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
230                                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_LOW|IRQF_ONESHOT);
231                                 else
232                                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_HIGH|IRQF_ONESHOT);
233                                 schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(0));     
234                                 wake_unlock(&headset_info->headset_on_wake);
235                                 return IRQ_HANDLED;
236                         }
237                         //adc_value = adc_sync_read(headset_info->client);
238                         printk("headset adc value = %d\n",adc_value);
239                         if(headset_info->isMic) {
240                                 if(adc_value > HOOK_DEFAULT_VAL || adc_value < HOOK_LEVEL_HIGH)
241                                         goto CHECK_AGAIN;
242                                 mod_timer(&headset_info->hook_timer, jiffies + msecs_to_jiffies(1000));
243                         }       
244                         //#endif                
245                         headset_info->cur_headset_status = headset_info->isMic ? BIT_HEADSET:BIT_HEADSET_NO_MIC;
246                 }
247                 else
248                 {
249                         headset_info->isMic= 0;//No microphone
250                         headset_info->cur_headset_status = BIT_HEADSET_NO_MIC;
251                 }
252                 printk("headset->isMic = %d\n",headset_info->isMic);            
253                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
254                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);
255                 else
256                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
257         }
258         else if(headset_info->headset_status == HEADSET_OUT)
259         {
260                 headset_info->cur_headset_status = ~(BIT_HEADSET|BIT_HEADSET_NO_MIC);
261                 del_timer(&headset_info->hook_timer);
262                 if(headset_info->isMic)
263                 {
264                         headset_info->hook_status = HOOK_UP;
265                         #ifdef CONFIG_SND_SOC_WM8994
266                         //rt5625_headset_mic_detect(false);
267                         wm8994_headset_mic_detect(false);
268                         #endif
269                         #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
270                         rt3261_headset_mic_detect(false);
271                         #endif
272                 }       
273                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
274                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
275                 else
276                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);                      
277         }       
278
279         rk28_send_wakeup_key();                 
280         switch_set_state(&headset_info->sdev, headset_info->cur_headset_status);        
281         DBG("headset notice android headset status = %d\n",headset_info->cur_headset_status);   
282
283 //      schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(0));
284 out:
285         headset_info->heatset_irq_working = IDLE;
286         wake_unlock(&headset_info->headset_on_wake);
287         return IRQ_HANDLED;
288 }
289
290 static int headset_change_irqtype(int type,unsigned int irq_type)
291 {
292         int ret = 0;
293         free_irq(headset_info->irq[type],NULL);
294
295         DBG("%s: type is %s irqtype is %s\n",__FUNCTION__,      type?"hook":"headset",(irq_type == IRQF_TRIGGER_RISING)?"RISING":"FALLING");
296 //      DBG("%s: type is %s irqtype is %s\n",__FUNCTION__,      type?"hook":"headset",(irq_type == IRQF_TRIGGER_LOW)?"LOW":"HIGH");
297         switch(type)
298         {
299         case HEADSET:
300                 ret = request_threaded_irq(headset_info->irq[type],NULL, headset_interrupt, irq_type, "headset_input", NULL);
301                 if (ret<0) 
302                         DBG("headset_change_irqtype: request irq failed\n");            
303                 break;
304         default:
305                 ret = -1;
306                 break;
307         }
308         return ret;
309 }
310 //2
311 static void headsetobserve_work(struct work_struct *work)
312 {
313         struct rk_headset_pdata *pdata = headset_info->pdata;
314         DBG("In the headsetobserve_work headset_status is %s\n",headset_info->headset_status?"in":"out");
315
316         if(headset_info->heatset_irq_working == WAIT && headset_info->headset_status == HEADSET_IN)
317         {
318                 printk("wait for codec\n");
319                 headset_info->heatset_irq_working = IDLE;
320                 headset_info->headset_status = HEADSET_OUT;     
321                 
322                 free_irq(headset_info->irq[HEADSET],NULL);      
323                 msleep(100);
324                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
325                         headset_info->irq_type[HEADSET] = IRQF_TRIGGER_HIGH|IRQF_ONESHOT;
326                 else
327                         headset_info->irq_type[HEADSET] = IRQF_TRIGGER_LOW|IRQF_ONESHOT;
328                 if(request_threaded_irq(headset_info->irq[HEADSET], NULL,headset_interrupt, headset_info->irq_type[HEADSET]|IRQF_NO_SUSPEND, "headset_input", NULL) < 0)
329                         printk("headset request_threaded_irq error\n");
330                 return; 
331         }
332 /*      
333         if(pdata->headset_in_type == HEADSET_IN_HIGH && headset_info->headset_status == HEADSET_IN)
334                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_FALLING);
335         else if(pdata->headset_in_type == HEADSET_IN_LOW && headset_info->headset_status == HEADSET_IN)
336                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_RISING);
337
338         if(pdata->headset_in_type == HEADSET_IN_HIGH && headset_info->headset_status == HEADSET_OUT)
339                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_RISING);
340         else if(pdata->headset_in_type == HEADSET_IN_LOW && headset_info->headset_status == HEADSET_OUT)
341                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_FALLING);
342 */              
343 }
344 //4
345 static void hook_adc_callback(struct adc_client *client, void *client_param, int result)
346 {
347         int level = result;
348         struct headset_priv *headset = (struct headset_priv *)client_param;
349         struct rk_headset_pdata *pdata = headset->pdata;
350         static unsigned int old_status = HOOK_UP;
351
352 //      DBG("hook_adc_callback read adc value: %d\n",level);
353
354         if(level < 0)
355         {
356                 printk("%s:get adc level err = %d!\n",__FUNCTION__,level);
357                 return;
358         }
359
360         if(headset->headset_status == HEADSET_OUT
361                 || headset->heatset_irq_working == BUSY
362                 || headset->heatset_irq_working == WAIT
363                 || pdata->headset_in_type?gpio_get_value(pdata->Headset_gpio) == 0:gpio_get_value(pdata->Headset_gpio) > 0)
364         {
365                 DBG("Headset is out or waiting for headset is in or out,after same time check HOOK key\n");
366                 return;
367         }       
368         
369         old_status = headset->hook_status;
370         if(level < HOOK_LEVEL_LOW && level >= 0)        
371                 headset->hook_status = HOOK_DOWN;
372         else if(level > HOOK_LEVEL_HIGH && level < HOOK_DEFAULT_VAL)
373                 headset->hook_status = HOOK_UP;
374         else{
375                 DBG("hook_adc_callback read adc value.........outside showly....: %d\n",level);
376                 del_timer(&headset->hook_timer);
377                 mod_timer(&headset->hook_timer, jiffies + msecs_to_jiffies(500));
378                 return;
379         }
380         
381         if(old_status == headset->hook_status)
382         {
383         //      DBG("Hook adc read old_status == headset->hook_status hook_time = %d\n",headset->hook_time);
384                 return;
385         }       
386         
387         DBG("HOOK status is %s , adc value = %d hook_time = %d\n",headset->hook_status?"down":"up",level,headset->hook_time);   
388         if(headset->headset_status == HEADSET_OUT
389                 || headset->heatset_irq_working == BUSY
390                 || headset->heatset_irq_working == WAIT
391                 || (pdata->headset_in_type?gpio_get_value(pdata->Headset_gpio) == 0:gpio_get_value(pdata->Headset_gpio) > 0))
392                 DBG("headset is out,HOOK status must discard\n");
393         else
394         {
395                 input_report_key(headset->input_dev,pdata->hook_key_code,headset->hook_status);
396                 input_sync(headset->input_dev);
397         }       
398 }
399 //3
400 static void hook_timer_callback(unsigned long arg)
401 {
402         struct headset_priv *headset = (struct headset_priv *)(arg);
403 //      DBG("hook_timer_callback\n");
404         if(headset->headset_status == HEADSET_OUT
405                 || headset->heatset_irq_working == BUSY
406                 || headset->heatset_irq_working == WAIT)
407                 return;
408         adc_async_read(headset->client);
409         mod_timer(&headset->hook_timer, jiffies + msecs_to_jiffies(headset->hook_time));
410 }
411
412 static ssize_t h2w_print_name(struct switch_dev *sdev, char *buf)
413 {
414         return sprintf(buf, "Headset\n");
415 }
416
417 #ifdef CONFIG_HAS_EARLYSUSPEND
418 static void headset_early_resume(struct early_suspend *h)
419 {
420         schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(10));
421         //DBG(">>>>>headset_early_resume\n");
422 }
423
424 static struct early_suspend hs_early_suspend;
425 #endif
426
427 static int rk_Hskey_open(struct input_dev *dev)
428 {
429         //struct rk28_adckey *adckey = input_get_drvdata(dev);
430 //      DBG("===========rk_Hskey_open===========\n");
431         return 0;
432 }
433
434 static void rk_Hskey_close(struct input_dev *dev)
435 {
436 //      DBG("===========rk_Hskey_close===========\n");
437 //      struct rk28_adckey *adckey = input_get_drvdata(dev);
438
439 }
440
441 static int rockchip_headsetobserve_probe(struct platform_device *pdev)
442 {
443         int ret;
444         struct headset_priv *headset;
445         struct rk_headset_pdata *pdata;
446
447         headset = kzalloc(sizeof(struct headset_priv), GFP_KERNEL);
448         if (headset == NULL) {
449                 dev_err(&pdev->dev, "failed to allocate driver data\n");
450                 return -ENOMEM;
451         }
452         headset_info = headset;
453         headset->pdata = pdev->dev.platform_data;
454         pdata = headset->pdata;
455         headset->headset_status = HEADSET_OUT;
456         headset->heatset_irq_working = IDLE;
457         headset->hook_status = HOOK_UP;
458         headset->hook_time = HOOK_ADC_SAMPLE_TIME;
459         headset->cur_headset_status = 0;
460         headset->sdev.name = "h2w";
461         headset->sdev.print_name = h2w_print_name;
462         ret = switch_dev_register(&headset->sdev);
463         if (ret < 0)
464                 goto failed_free;
465         
466 //      mutex_init(&headset->mutex_lock[HEADSET]);
467 //      mutex_init(&headset->mutex_lock[HOOK]);
468         wake_lock_init(&headset->headset_on_wake, WAKE_LOCK_SUSPEND, "headset_on_wake");
469         INIT_DELAYED_WORK(&headset->h_delayed_work[HEADSET], headsetobserve_work);
470
471         headset->isMic = 0;
472 //------------------------------------------------------------------            
473         // Create and register the input driver. 
474         headset->input_dev = input_allocate_device();
475         if (!headset->input_dev) {
476                 dev_err(&pdev->dev, "failed to allocate input device\n");
477                 ret = -ENOMEM;
478                 goto failed_free;
479         }       
480         headset->input_dev->name = pdev->name;
481         headset->input_dev->open = rk_Hskey_open;
482         headset->input_dev->close = rk_Hskey_close;
483         headset->input_dev->dev.parent = &pdev->dev;
484         //input_dev->phys = KEY_PHYS_NAME;
485         headset->input_dev->id.vendor = 0x0001;
486         headset->input_dev->id.product = 0x0001;
487         headset->input_dev->id.version = 0x0100;
488         // Register the input device 
489         ret = input_register_device(headset->input_dev);
490         if (ret) {
491                 dev_err(&pdev->dev, "failed to register input device\n");
492                 goto failed_free_dev;
493         }
494
495         input_set_capability(headset->input_dev, EV_KEY, pdata->hook_key_code);
496 //------------------------------------------------------------------
497         if (pdata->Headset_gpio) {
498                 ret = pdata->headset_io_init(pdata->Headset_gpio, pdata->headset_gpio_info.iomux_name, pdata->headset_gpio_info.iomux_mode);
499                 if (ret) 
500                         goto failed_free;
501
502                 headset->irq[HEADSET] = gpio_to_irq(pdata->Headset_gpio);
503
504                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
505                         headset->irq_type[HEADSET] = IRQF_TRIGGER_HIGH|IRQF_ONESHOT;
506                 else
507                         headset->irq_type[HEADSET] = IRQF_TRIGGER_LOW|IRQF_ONESHOT;
508                 ret = request_threaded_irq(headset->irq[HEADSET], NULL,headset_interrupt, headset->irq_type[HEADSET]|IRQF_NO_SUSPEND, "headset_input", NULL);
509                 if (ret) 
510                         goto failed_free;
511                 enable_irq_wake(headset->irq[HEADSET]);
512         }
513         else
514                 goto failed_free;
515 //------------------------------------------------------------------
516         if(pdata->Hook_adc_chn>=0 && 3>=pdata->Hook_adc_chn)
517         {
518                 headset->client = adc_register(pdata->Hook_adc_chn, hook_adc_callback, (void *)headset);
519                 if(!headset->client) {
520                         printk("hook adc register error\n");
521                         ret = -EINVAL;
522                         goto failed_free;
523                 }
524                 setup_timer(&headset->hook_timer,hook_timer_callback, (unsigned long)headset);  
525                 printk("headset adc default value = %d\n",adc_sync_read(headset->client));
526         }
527         
528 #ifdef CONFIG_HAS_EARLYSUSPEND
529         hs_early_suspend.suspend = NULL;
530         hs_early_suspend.resume = headset_early_resume;
531         hs_early_suspend.level = ~0x0;
532         register_early_suspend(&hs_early_suspend);
533 #endif
534
535         return 0;       
536         
537 failed_free_dev:
538         platform_set_drvdata(pdev, NULL);
539         input_free_device(headset->input_dev);
540 failed_free:
541         dev_err(&pdev->dev, "failed to headset probe\n");
542         kfree(headset);
543         return ret;
544 }
545
546 static int rockchip_headsetobserve_suspend(struct platform_device *pdev, pm_message_t state)
547 {
548         DBG("%s----%d\n",__FUNCTION__,__LINE__);
549 //      disable_irq(headset_info->irq[HEADSET]);
550         del_timer(&headset_info->hook_timer);
551         return 0;
552 }
553
554 static int rockchip_headsetobserve_resume(struct platform_device *pdev)
555 {
556         DBG("%s----%d\n",__FUNCTION__,__LINE__);        
557 //      enable_irq(headset_info->irq[HEADSET]);
558         if(headset_info->isMic)
559                 mod_timer(&headset_info->hook_timer, jiffies + msecs_to_jiffies(1500)); 
560         return 0;
561 }
562
563 static struct platform_driver rockchip_headsetobserve_driver = {
564         .probe  = rockchip_headsetobserve_probe,
565         .resume =       rockchip_headsetobserve_resume, 
566         .suspend =      rockchip_headsetobserve_suspend,        
567         .driver = {
568                 .name   = "rk_headsetdet",
569                 .owner  = THIS_MODULE,
570         },
571 };
572
573 static int __init rockchip_headsetobserve_init(void)
574 {
575         platform_driver_register(&rockchip_headsetobserve_driver);
576         return 0;
577 }
578 late_initcall(rockchip_headsetobserve_init);
579 MODULE_DESCRIPTION("Rockchip Headset Driver");
580 MODULE_LICENSE("GPL");
581