esp8089: fix ESP8089 wifi can not work when use CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOT
[firefly-linux-kernel-4.4.55.git] / drivers / headset_observe / rk_headset.c
index d72b0c46acf82be5454f4ee3ef4bc35f9460e7d6..e6b6a289a548d993d31227cc09a31c565126887d 100755 (executable)
 #include <linux/err.h>
 #include <linux/hrtimer.h>
 #include <linux/switch.h>
-#include <linux/input.h>
 #include <linux/debugfs.h>
 #include <linux/wakelock.h>
-#include <asm/gpio.h>
+#include <linux/gpio.h>
 #include <asm/atomic.h>
-#include <asm/mach-types.h>
 #include <linux/pm.h>
 #include <linux/i2c.h>
 #include <linux/spi/spi.h>
@@ -447,7 +445,8 @@ int rk_headset_probe(struct platform_device *pdev,struct rk_headset_pdata *pdata
                ret = request_irq(headset->irq[HEADSET], headset_interrupt, headset->irq_type[HEADSET], "headset_input", NULL);
                if (ret) 
                        goto failed_free_dev;
-               enable_irq_wake(headset->irq[HEADSET]);
+               if (pdata->headset_wakeup)
+                       enable_irq_wake(headset->irq[HEADSET]);
        }
        else
                goto failed_free_dev;