lkml.org 
[lkml]   [2015]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/2] Input: atmel_mxt_ts - add support for Google Pixel 2
On Wed, Apr 15, 2015 at 05:58:04PM +0200, Javier Martinez Canillas wrote:
> On 04/08/2015 02:26 AM, Dmitry Torokhov wrote:
> > @@ -724,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
> > {
> > struct input_dev *input = data->input_dev;
> > const struct mxt_platform_data *pdata = data->pdata;
> > - bool button;
> > int i;
> >
> > - /* Active-low switch */
> > for (i = 0; i < pdata->t19_num_keys; i++) {
> > if (pdata->t19_keymap[i] == KEY_RESERVED)
> > continue;
> > - button = !(message[1] & (1 << i));
> > - input_report_key(input, pdata->t19_keymap[i], button);
> > +
> > + /* Active-low switch */
> > + input_report_key(input, pdata->t19_keymap[i],
> > + !(message[1] & BIT(i)));
>
> This is an unrelated cleanup so probably should had been a separate patch?

Fair enough.

--
Dmitry


Input: atmel_mxt_ts - use BIT() macro when reporting button state

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

This makes the intent a tad more clear.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 0d87ffc..0dcd455 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -726,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
{
struct input_dev *input = data->input_dev;
const struct mxt_platform_data *pdata = data->pdata;
- bool button;
int i;

- /* Active-low switch */
for (i = 0; i < pdata->t19_num_keys; i++) {
if (pdata->t19_keymap[i] == KEY_RESERVED)
continue;
- button = !(message[1] & (1 << i));
- input_report_key(input, pdata->t19_keymap[i], button);
+
+ /* Active-low switch */
+ input_report_key(input, pdata->t19_keymap[i],
+ !(message[1] & BIT(i)));
}
}


\
 
 \ /
  Last update: 2015-04-15 20:01    [W:0.105 / U:7.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site