summaryrefslogtreecommitdiff
path: root/drivers/misc/bq5105x_detect.c
diff options
context:
space:
mode:
authorAmit Jain <ajain@motorola.com>2014-10-02 11:11:23 -0500
committerAmit Jain <ajain@motorola.com>2014-10-03 13:37:12 +0000
commit58efe519a5477c70a184cdf376520122127f69f0 (patch)
tree597aef9bad8256e13a695b110888ac697b8c9589 /drivers/misc/bq5105x_detect.c
parent079a36c83139757332cde9a8a588d7249645283b (diff)
downloadolio-linux-3.10-58efe519a5477c70a184cdf376520122127f69f0.tar.xz
olio-linux-3.10-58efe519a5477c70a184cdf376520122127f69f0.zip
IKXCLOCK-4061: power key behavior change
Diffstat (limited to 'drivers/misc/bq5105x_detect.c')
-rw-r--r--drivers/misc/bq5105x_detect.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/bq5105x_detect.c b/drivers/misc/bq5105x_detect.c
index 37cbdcaa11c..4c01828f5ca 100644
--- a/drivers/misc/bq5105x_detect.c
+++ b/drivers/misc/bq5105x_detect.c
@@ -31,7 +31,12 @@
#include <linux/switch.h>
#include <linux/wakelock.h>
#include <linux/workqueue.h>
+#ifdef CONFIG_WAKEUP_SOURCE_NOTIFY
#include <linux/wakeup_source_notify.h>
+#endif
+#ifdef CONFIG_POWER_KEY_OVERRIDE
+#include <linux/charger_notify.h>
+#endif
/*
* Detect when a device is placed on a wireless charger and report this to user
@@ -215,6 +220,10 @@ static void bq5105x_detect_report(struct bq5105x_detect *chip, bool docked)
{
if (chip->reported_docked != docked) {
dev_dbg(&chip->pdev->dev, "report docked=%d\n", docked);
+#ifdef CONFIG_POWER_KEY_OVERRIDE
+ charger_notify_subscriber(docked
+ ? EVENT_DOCKON : EVENT_DOCKOFF);
+#endif
#ifdef CONFIG_WAKEUP_SOURCE_NOTIFY
wakeup_source_notify_subscriber(docked
? DISPLAY_WAKE_EVENT_DOCKON