Merge remote-tracking branch 'stable/linux-3.0.y' into develop-3.0
[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         for(i=0; i<3; i++)
129         {
130                 level = gpio_get_value(pdata->Headset_gpio);
131                 if(level < 0)
132                 {
133                         printk("%s:get pin level again,pin=%d,i=%d\n",__FUNCTION__,pdata->Headset_gpio,i);
134                         msleep(1);
135                         continue;
136                 }
137                 else
138                 break;
139         }
140         if(level < 0)
141         {
142                 printk("%s:get pin level  err!\n",__FUNCTION__);
143                 goto out;
144         }
145
146         old_status = headset_info->headset_status;
147         switch(pdata->headset_in_type)
148         {
149         case HEADSET_IN_HIGH:
150                 if(level > 0)
151                         headset_info->headset_status = HEADSET_IN;
152                 else if(level == 0)
153                         headset_info->headset_status = HEADSET_OUT;     
154                 break;
155         case HEADSET_IN_LOW:
156                 if(level == 0)
157                         headset_info->headset_status = HEADSET_IN;
158                 else if(level > 0)
159                         headset_info->headset_status = HEADSET_OUT;             
160                 break;                  
161         default:
162                 DBG("---- ERROR: on headset headset_in_type error -----\n");
163                 break;                  
164         }
165         if(old_status == headset_info->headset_status)
166         {
167                 DBG("Read Headset IO level old status == now status\n");
168                 goto out;
169         }
170
171         DBG("(headset in is %s)headset status is %s\n",
172                 pdata->headset_in_type?"high level":"low level",
173                 headset_info->headset_status?"in":"out");
174         if(headset_info->headset_status == HEADSET_IN)
175         {
176                 #if 0
177                 while(1)
178                 {
179                         if(adc_sync_read(headset_info->client) > HOOK_DEFAULT_VAL
180                          || adc_sync_read(headset_info->client) < 0)
181                         {
182                                 printk("headset is showly inside\n");
183                         }
184                         else
185                                 break;
186                         msleep(50);
187                         
188                         if(pdata->headset_in_type == HEADSET_IN_HIGH)
189                                 old_status = headset_info->headset_status = gpio_get_value(pdata->Headset_gpio)?HEADSET_IN:HEADSET_OUT;
190                         else
191                                 old_status = headset_info->headset_status = gpio_get_value(pdata->Headset_gpio)?HEADSET_OUT:HEADSET_IN;
192                         if(headset_info->headset_status == HEADSET_OUT)
193                                 goto out1;
194                         msleep(5);      
195                 }
196                 #endif
197                 if(pdata->Hook_adc_chn>=0 && 3>=pdata->Hook_adc_chn)
198                 {
199                 // wait for find Hook key
200                         //#ifdef CONFIG_SND_SOC_RT5625
201                         CHECK_AGAIN:
202                         //headset_info->isMic = rt5625_headset_mic_detect(true);
203                         #ifdef CONFIG_SND_SOC_WM8994
204                         wm8994_headset_mic_detect(true);
205                         #endif
206                         #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
207                         rt3261_headset_mic_detect(true);
208                         #endif
209                         //mdelay(400);
210                         adc_value = adc_sync_read(headset_info->client);
211                         if(adc_value >= 0 && adc_value < HOOK_LEVEL_LOW)
212                         {
213                                 headset_info->isMic= 0;//No microphone
214                                 #ifdef CONFIG_SND_SOC_WM8994
215                                 wm8994_headset_mic_detect(false);
216                                 #endif
217                                 #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
218                                 rt3261_headset_mic_detect(false);
219                                 #endif  
220                         }       
221                         else if(adc_value >= HOOK_LEVEL_HIGH)
222                                 headset_info->isMic = 1;//have mic
223
224                         if(headset_info->isMic < 0)     
225                         {
226                                 printk("codec is error\n");
227                                 headset_info->heatset_irq_working = WAIT;
228                                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
229                                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_LOW|IRQF_ONESHOT);
230                                 else
231                                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_HIGH|IRQF_ONESHOT);
232                                 schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(0));     
233                                 wake_unlock(&headset_info->headset_on_wake);
234                                 return IRQ_HANDLED;
235                         }
236                         //adc_value = adc_sync_read(headset_info->client);
237                         printk("headset adc value = %d\n",adc_value);
238                         if(headset_info->isMic) {
239                                 if(adc_value > HOOK_DEFAULT_VAL || adc_value < HOOK_LEVEL_HIGH)
240                                         goto CHECK_AGAIN;
241                                 mod_timer(&headset_info->hook_timer, jiffies + msecs_to_jiffies(1000));
242                         }       
243                         //#endif                
244                         headset_info->cur_headset_status = headset_info->isMic ? BIT_HEADSET:BIT_HEADSET_NO_MIC;
245                 }
246                 else
247                 {
248                         headset_info->isMic= 0;//No microphone
249                         headset_info->cur_headset_status = BIT_HEADSET_NO_MIC;
250                 }
251                 printk("headset->isMic = %d\n",headset_info->isMic);            
252                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
253                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);
254                 else
255                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
256         }
257         else if(headset_info->headset_status == HEADSET_OUT)
258         {
259                 headset_info->cur_headset_status = ~(BIT_HEADSET|BIT_HEADSET_NO_MIC);
260                 del_timer(&headset_info->hook_timer);
261                 if(headset_info->isMic)
262                 {
263                         headset_info->hook_status = HOOK_UP;
264                         #ifdef CONFIG_SND_SOC_WM8994
265                         //rt5625_headset_mic_detect(false);
266                         wm8994_headset_mic_detect(false);
267                         #endif
268                         #if defined (CONFIG_SND_SOC_RT3261) || defined (CONFIG_SND_SOC_RT3224)
269                         rt3261_headset_mic_detect(false);
270                         #endif
271                 }       
272                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
273                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
274                 else
275                         irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);                      
276         }       
277
278         rk28_send_wakeup_key();                 
279         switch_set_state(&headset_info->sdev, headset_info->cur_headset_status);        
280         DBG("headset notice android headset status = %d\n",headset_info->cur_headset_status);   
281
282 //      schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(0));
283 out:
284         headset_info->heatset_irq_working = IDLE;
285         wake_unlock(&headset_info->headset_on_wake);
286         return IRQ_HANDLED;
287 }
288
289 static int headset_change_irqtype(int type,unsigned int irq_type)
290 {
291         int ret = 0;
292         free_irq(headset_info->irq[type],NULL);
293
294         DBG("%s: type is %s irqtype is %s\n",__FUNCTION__,      type?"hook":"headset",(irq_type == IRQF_TRIGGER_RISING)?"RISING":"FALLING");
295 //      DBG("%s: type is %s irqtype is %s\n",__FUNCTION__,      type?"hook":"headset",(irq_type == IRQF_TRIGGER_LOW)?"LOW":"HIGH");
296         switch(type)
297         {
298         case HEADSET:
299                 ret = request_threaded_irq(headset_info->irq[type],NULL, headset_interrupt, irq_type, "headset_input", NULL);
300                 if (ret<0) 
301                         DBG("headset_change_irqtype: request irq failed\n");            
302                 break;
303         default:
304                 ret = -1;
305                 break;
306         }
307         return ret;
308 }
309 //2
310 static void headsetobserve_work(struct work_struct *work)
311 {
312         struct rk_headset_pdata *pdata = headset_info->pdata;
313         DBG("In the headsetobserve_work headset_status is %s\n",headset_info->headset_status?"in":"out");
314
315         if(headset_info->heatset_irq_working == WAIT && headset_info->headset_status == HEADSET_IN)
316         {
317                 printk("wait for codec\n");
318                 headset_info->heatset_irq_working = IDLE;
319                 headset_info->headset_status = HEADSET_OUT;     
320                 
321                 free_irq(headset_info->irq[HEADSET],NULL);      
322                 msleep(100);
323                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
324                         headset_info->irq_type[HEADSET] = IRQF_TRIGGER_HIGH|IRQF_ONESHOT;
325                 else
326                         headset_info->irq_type[HEADSET] = IRQF_TRIGGER_LOW|IRQF_ONESHOT;
327                 if(request_threaded_irq(headset_info->irq[HEADSET], NULL,headset_interrupt, headset_info->irq_type[HEADSET]|IRQF_NO_SUSPEND, "headset_input", NULL) < 0)
328                         printk("headset request_threaded_irq error\n");
329                 return; 
330         }
331 /*      
332         if(pdata->headset_in_type == HEADSET_IN_HIGH && headset_info->headset_status == HEADSET_IN)
333                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_FALLING);
334         else if(pdata->headset_in_type == HEADSET_IN_LOW && headset_info->headset_status == HEADSET_IN)
335                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_RISING);
336
337         if(pdata->headset_in_type == HEADSET_IN_HIGH && headset_info->headset_status == HEADSET_OUT)
338                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_RISING);
339         else if(pdata->headset_in_type == HEADSET_IN_LOW && headset_info->headset_status == HEADSET_OUT)
340                 headset_change_irqtype(HEADSET,IRQF_TRIGGER_FALLING);
341 */              
342 }
343 //4
344 static void hook_adc_callback(struct adc_client *client, void *client_param, int result)
345 {
346         int level = result;
347         struct headset_priv *headset = (struct headset_priv *)client_param;
348         struct rk_headset_pdata *pdata = headset->pdata;
349         static unsigned int old_status = HOOK_UP;
350
351 //      DBG("hook_adc_callback read adc value: %d\n",level);
352
353         if(level < 0)
354         {
355                 printk("%s:get adc level err = %d!\n",__FUNCTION__,level);
356                 return;
357         }
358
359         if(headset->headset_status == HEADSET_OUT
360                 || headset->heatset_irq_working == BUSY
361                 || headset->heatset_irq_working == WAIT
362                 || pdata->headset_in_type?gpio_get_value(pdata->Headset_gpio) == 0:gpio_get_value(pdata->Headset_gpio) > 0)
363         {
364                 DBG("Headset is out or waiting for headset is in or out,after same time check HOOK key\n");
365                 return;
366         }       
367         
368         old_status = headset->hook_status;
369         if(level < HOOK_LEVEL_LOW && level >= 0)        
370                 headset->hook_status = HOOK_DOWN;
371         else if(level > HOOK_LEVEL_HIGH && level < HOOK_DEFAULT_VAL)
372                 headset->hook_status = HOOK_UP;
373         else{
374                 DBG("hook_adc_callback read adc value.........outside showly....: %d\n",level);
375                 del_timer(&headset->hook_timer);
376                 mod_timer(&headset->hook_timer, jiffies + msecs_to_jiffies(500));
377                 return;
378         }
379         
380         if(old_status == headset->hook_status)
381         {
382         //      DBG("Hook adc read old_status == headset->hook_status hook_time = %d\n",headset->hook_time);
383                 return;
384         }       
385         
386         DBG("HOOK status is %s , adc value = %d hook_time = %d\n",headset->hook_status?"down":"up",level,headset->hook_time);   
387         if(headset->headset_status == HEADSET_OUT
388                 || headset->heatset_irq_working == BUSY
389                 || headset->heatset_irq_working == WAIT
390                 || (pdata->headset_in_type?gpio_get_value(pdata->Headset_gpio) == 0:gpio_get_value(pdata->Headset_gpio) > 0))
391                 DBG("headset is out,HOOK status must discard\n");
392         else
393         {
394                 input_report_key(headset->input_dev,pdata->hook_key_code,headset->hook_status);
395                 input_sync(headset->input_dev);
396         }       
397 }
398 //3
399 static void hook_timer_callback(unsigned long arg)
400 {
401         struct headset_priv *headset = (struct headset_priv *)(arg);
402 //      DBG("hook_timer_callback\n");
403         if(headset->headset_status == HEADSET_OUT
404                 || headset->heatset_irq_working == BUSY
405                 || headset->heatset_irq_working == WAIT)
406                 return;
407         adc_async_read(headset->client);
408         mod_timer(&headset->hook_timer, jiffies + msecs_to_jiffies(headset->hook_time));
409 }
410
411 static ssize_t h2w_print_name(struct switch_dev *sdev, char *buf)
412 {
413         return sprintf(buf, "Headset\n");
414 }
415
416 #ifdef CONFIG_HAS_EARLYSUSPEND
417 static void headset_early_resume(struct early_suspend *h)
418 {
419         schedule_delayed_work(&headset_info->h_delayed_work[HEADSET], msecs_to_jiffies(10));
420         //DBG(">>>>>headset_early_resume\n");
421 }
422
423 static struct early_suspend hs_early_suspend;
424 #endif
425
426 static int rk_Hskey_open(struct input_dev *dev)
427 {
428         //struct rk28_adckey *adckey = input_get_drvdata(dev);
429 //      DBG("===========rk_Hskey_open===========\n");
430         return 0;
431 }
432
433 static void rk_Hskey_close(struct input_dev *dev)
434 {
435 //      DBG("===========rk_Hskey_close===========\n");
436 //      struct rk28_adckey *adckey = input_get_drvdata(dev);
437
438 }
439
440 static int rockchip_headsetobserve_probe(struct platform_device *pdev)
441 {
442         int ret;
443         struct headset_priv *headset;
444         struct rk_headset_pdata *pdata;
445
446         headset = kzalloc(sizeof(struct headset_priv), GFP_KERNEL);
447         if (headset == NULL) {
448                 dev_err(&pdev->dev, "failed to allocate driver data\n");
449                 return -ENOMEM;
450         }
451         headset_info = headset;
452         headset->pdata = pdev->dev.platform_data;
453         pdata = headset->pdata;
454         headset->headset_status = HEADSET_OUT;
455         headset->heatset_irq_working = IDLE;
456         headset->hook_status = HOOK_UP;
457         headset->hook_time = HOOK_ADC_SAMPLE_TIME;
458         headset->cur_headset_status = 0;
459         headset->sdev.name = "h2w";
460         headset->sdev.print_name = h2w_print_name;
461         ret = switch_dev_register(&headset->sdev);
462         if (ret < 0)
463                 goto failed_free;
464         
465 //      mutex_init(&headset->mutex_lock[HEADSET]);
466 //      mutex_init(&headset->mutex_lock[HOOK]);
467         wake_lock_init(&headset->headset_on_wake, WAKE_LOCK_SUSPEND, "headset_on_wake");
468         INIT_DELAYED_WORK(&headset->h_delayed_work[HEADSET], headsetobserve_work);
469
470         headset->isMic = 0;
471 //------------------------------------------------------------------            
472         // Create and register the input driver. 
473         headset->input_dev = input_allocate_device();
474         if (!headset->input_dev) {
475                 dev_err(&pdev->dev, "failed to allocate input device\n");
476                 ret = -ENOMEM;
477                 goto failed_free;
478         }       
479         headset->input_dev->name = pdev->name;
480         headset->input_dev->open = rk_Hskey_open;
481         headset->input_dev->close = rk_Hskey_close;
482         headset->input_dev->dev.parent = &pdev->dev;
483         //input_dev->phys = KEY_PHYS_NAME;
484         headset->input_dev->id.vendor = 0x0001;
485         headset->input_dev->id.product = 0x0001;
486         headset->input_dev->id.version = 0x0100;
487         // Register the input device 
488         ret = input_register_device(headset->input_dev);
489         if (ret) {
490                 dev_err(&pdev->dev, "failed to register input device\n");
491                 goto failed_free_dev;
492         }
493
494         input_set_capability(headset->input_dev, EV_KEY, pdata->hook_key_code);
495 //------------------------------------------------------------------
496         if (pdata->Headset_gpio) {
497                 ret = pdata->headset_io_init(pdata->Headset_gpio, pdata->headset_gpio_info.iomux_name, pdata->headset_gpio_info.iomux_mode);
498                 if (ret) 
499                         goto failed_free;
500
501                 headset->irq[HEADSET] = gpio_to_irq(pdata->Headset_gpio);
502
503                 if(pdata->headset_in_type == HEADSET_IN_HIGH)
504                         headset->irq_type[HEADSET] = IRQF_TRIGGER_HIGH|IRQF_ONESHOT;
505                 else
506                         headset->irq_type[HEADSET] = IRQF_TRIGGER_LOW|IRQF_ONESHOT;
507                 ret = request_threaded_irq(headset->irq[HEADSET], NULL,headset_interrupt, headset->irq_type[HEADSET]|IRQF_NO_SUSPEND, "headset_input", NULL);
508                 if (ret) 
509                         goto failed_free;
510                 enable_irq_wake(headset->irq[HEADSET]);
511         }
512         else
513                 goto failed_free;
514 //------------------------------------------------------------------
515         if(pdata->Hook_adc_chn>=0 && 3>=pdata->Hook_adc_chn)
516         {
517                 headset->client = adc_register(pdata->Hook_adc_chn, hook_adc_callback, (void *)headset);
518                 if(!headset->client) {
519                         printk("hook adc register error\n");
520                         ret = -EINVAL;
521                         goto failed_free;
522                 }
523                 setup_timer(&headset->hook_timer,hook_timer_callback, (unsigned long)headset);  
524                 printk("headset adc default value = %d\n",adc_sync_read(headset->client));
525         }
526         
527 #ifdef CONFIG_HAS_EARLYSUSPEND
528         hs_early_suspend.suspend = NULL;
529         hs_early_suspend.resume = headset_early_resume;
530         hs_early_suspend.level = ~0x0;
531         register_early_suspend(&hs_early_suspend);
532 #endif
533
534         return 0;       
535         
536 failed_free_dev:
537         platform_set_drvdata(pdev, NULL);
538         input_free_device(headset->input_dev);
539 failed_free:
540         dev_err(&pdev->dev, "failed to headset probe\n");
541         kfree(headset);
542         return ret;
543 }
544
545 static int rockchip_headsetobserve_suspend(struct platform_device *pdev, pm_message_t state)
546 {
547         DBG("%s----%d\n",__FUNCTION__,__LINE__);
548 //      disable_irq(headset_info->irq[HEADSET]);
549         del_timer(&headset_info->hook_timer);
550         return 0;
551 }
552
553 static int rockchip_headsetobserve_resume(struct platform_device *pdev)
554 {
555         DBG("%s----%d\n",__FUNCTION__,__LINE__);        
556 //      enable_irq(headset_info->irq[HEADSET]);
557         if(headset_info->isMic)
558                 mod_timer(&headset_info->hook_timer, jiffies + msecs_to_jiffies(1500)); 
559         return 0;
560 }
561
562 static struct platform_driver rockchip_headsetobserve_driver = {
563         .probe  = rockchip_headsetobserve_probe,
564         .resume =       rockchip_headsetobserve_resume, 
565         .suspend =      rockchip_headsetobserve_suspend,        
566         .driver = {
567                 .name   = "rk_headsetdet",
568                 .owner  = THIS_MODULE,
569         },
570 };
571
572 static int __init rockchip_headsetobserve_init(void)
573 {
574         platform_driver_register(&rockchip_headsetobserve_driver);
575         return 0;
576 }
577 late_initcall(rockchip_headsetobserve_init);
578 MODULE_DESCRIPTION("Rockchip Headset Driver");
579 MODULE_LICENSE("GPL");
580