Commit c37f6d38 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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

This makes the intent a tad more clear.
Reviewed-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent dccf1dd8
...@@ -726,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message) ...@@ -726,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
{ {
struct input_dev *input = data->input_dev; struct input_dev *input = data->input_dev;
const struct mxt_platform_data *pdata = data->pdata; const struct mxt_platform_data *pdata = data->pdata;
bool button;
int i; int i;
/* Active-low switch */
for (i = 0; i < pdata->t19_num_keys; i++) { for (i = 0; i < pdata->t19_num_keys; i++) {
if (pdata->t19_keymap[i] == KEY_RESERVED) if (pdata->t19_keymap[i] == KEY_RESERVED)
continue; 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)));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment