From: Henrik Rydberg Date: Fri, 25 Feb 2011 17:33:13 +0000 (-0800) Subject: Input: bcm5974 - Report button also for zero fingers X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5063511539bbb436ae8e4f75409561ef547f8516;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Input: bcm5974 - Report button also for zero fingers With the current code, pressing the integrated button with an isolating tool does not result in any button report. Fixed with this this patch. Signed-off-by: Henrik Rydberg Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index b9523176391..d24837210f0 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -390,10 +390,6 @@ static int report_tp_state(struct bcm5974 *dev, int size) ptest = int2bound(&c->p, raw_p); origin = raw2int(f->origin); - /* set the integrated button if applicable */ - if (c->tp_type == TYPE2) - ibt = raw2int(dev->tp_data[BUTTON_TYPE2]); - /* while tracking finger still valid, count all fingers */ if (ptest > PRESSURE_LOW && origin) { abs_p = ptest; @@ -412,6 +408,10 @@ static int report_tp_state(struct bcm5974 *dev, int size) } } + /* set the integrated button if applicable */ + if (c->tp_type == TYPE2) + ibt = raw2int(dev->tp_data[BUTTON_TYPE2]); + if (dev->fingers < nmin) dev->fingers = nmin; if (dev->fingers > nmax)