summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-04-26 18:49:04 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-26 18:49:03 -0700
commit7d78f564ebe64a5c1977e6debbe25cd06bcd5902 (patch)
treef6b5168dd2bb57215cca035bbc377e719fee4108
parentb1980b6bfedd0ac23e3b0320a8ed9bf7959e88bb (diff)
parent78f7468f2e03153e2f779ed75a76539abb9ae607 (diff)
Merge "input: misc: hbtp_input: filter out fb events"
-rw-r--r--drivers/input/misc/hbtp_input.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/input/misc/hbtp_input.c b/drivers/input/misc/hbtp_input.c
index 6d2e7a569044..21898c308075 100644
--- a/drivers/input/misc/hbtp_input.c
+++ b/drivers/input/misc/hbtp_input.c
@@ -109,10 +109,27 @@ static int fb_notifier_callback(struct notifier_block *self,
{
int blank;
struct fb_event *evdata = data;
+ struct fb_info *fbi = NULL;
struct hbtp_data *hbtp_data =
container_of(self, struct hbtp_data, fb_notif);
- if (evdata && evdata->data && hbtp_data &&
+ if (!evdata) {
+ pr_debug("evdata is NULL");
+ return 0;
+ }
+ fbi = evdata->info;
+
+ /*
+ * Node 0 is the primary display and others are
+ * external displays such as HDMI/DP.
+ * We need to handle only fb event for the primary display.
+ */
+ if (!fbi || fbi->node != 0) {
+ pr_debug("%s: no need to handle the fb event", __func__);
+ return 0;
+ }
+
+ if (evdata->data && hbtp_data &&
(event == FB_EARLY_EVENT_BLANK ||
event == FB_R_EARLY_EVENT_BLANK)) {
blank = *(int *)(evdata->data);
@@ -141,7 +158,7 @@ static int fb_notifier_callback(struct notifier_block *self,
}
}
- if (evdata && evdata->data && hbtp_data &&
+ if (evdata->data && hbtp_data &&
event == FB_EVENT_BLANK) {
blank = *(int *)(evdata->data);
if (blank == FB_BLANK_POWERDOWN) {