Commit a5a45b7f authored by Marcus Folkesson's avatar Marcus Folkesson Committed by Dmitry Torokhov

Input: gamecon - avoid using __set_bit() for capabilities

input_set_capability() and input_set_abs_param() will do it for you.
Signed-off-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 89223a2b
...@@ -862,7 +862,7 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type) ...@@ -862,7 +862,7 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
case GC_N64: case GC_N64:
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
__set_bit(gc_n64_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY, gc_n64_btn[i]);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
input_set_abs_params(input_dev, ABS_X + i, -127, 126, 0, 2); input_set_abs_params(input_dev, ABS_X + i, -127, 126, 0, 2);
...@@ -879,26 +879,27 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type) ...@@ -879,26 +879,27 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
break; break;
case GC_SNESMOUSE: case GC_SNESMOUSE:
__set_bit(BTN_LEFT, input_dev->keybit); input_set_capability(input_dev, EV_KEY, BTN_LEFT);
__set_bit(BTN_RIGHT, input_dev->keybit); input_set_capability(input_dev, EV_KEY, BTN_RIGHT);
__set_bit(REL_X, input_dev->relbit); input_set_capability(input_dev, EV_REL, REL_X);
__set_bit(REL_Y, input_dev->relbit); input_set_capability(input_dev, EV_REL, REL_Y);
break; break;
case GC_SNES: case GC_SNES:
for (i = 4; i < 8; i++) for (i = 4; i < 8; i++)
__set_bit(gc_snes_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY, gc_snes_btn[i]);
/* fall through */ /* fall through */
case GC_NES: case GC_NES:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
__set_bit(gc_snes_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY, gc_snes_btn[i]);
break; break;
case GC_MULTI2: case GC_MULTI2:
__set_bit(BTN_THUMB, input_dev->keybit); input_set_capability(input_dev, EV_KEY, BTN_THUMB);
/* fall through */ /* fall through */
case GC_MULTI: case GC_MULTI:
__set_bit(BTN_TRIGGER, input_dev->keybit); input_set_capability(input_dev, EV_KEY, BTN_TRIGGER);
/* fall through */
break; break;
case GC_PSX: case GC_PSX:
...@@ -906,15 +907,17 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type) ...@@ -906,15 +907,17 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
input_set_abs_params(input_dev, input_set_abs_params(input_dev,
gc_psx_abs[i], 4, 252, 0, 2); gc_psx_abs[i], 4, 252, 0, 2);
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
__set_bit(gc_psx_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY, gc_psx_btn[i]);
break;
break; break;
case GC_DDR: case GC_DDR:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
__set_bit(gc_psx_ddr_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY,
gc_psx_ddr_btn[i]);
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
__set_bit(gc_psx_btn[i], input_dev->keybit); input_set_capability(input_dev, EV_KEY, gc_psx_btn[i]);
break; break;
} }
......
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