Skip to content

Commit

Permalink
get rid of input BIT* duplicate defines
Browse files Browse the repository at this point in the history
get rid of input BIT* duplicate defines

use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1<<x)

Signed-off-by: Jiri Slaby <[email protected]>
Cc: <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Cc: <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Cc: <[email protected]>
Acked-by: Mauro Carvalho Chehab <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jirislaby authored and Linus Torvalds committed Oct 19, 2007
1 parent d05be13 commit 7b19ada
Show file tree
Hide file tree
Showing 110 changed files with 410 additions and 327 deletions.
15 changes: 8 additions & 7 deletions Documentation/input/input-programming.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static int __init button_init(void)
goto err_free_irq;
}

button_dev->evbit[0] = BIT(EV_KEY);
button_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
button_dev->evbit[0] = BIT_MASK(EV_KEY);
button_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);

error = input_register_device(button_dev);
if (error) {
Expand Down Expand Up @@ -217,14 +217,15 @@ If you don't need absfuzz and absflat, you can set them to zero, which mean
that the thing is precise and always returns to exactly the center position
(if it has any).

1.4 NBITS(), LONG(), BIT()
1.4 BITS_TO_LONGS(), BIT_WORD(), BIT_MASK()
~~~~~~~~~~~~~~~~~~~~~~~~~~

These three macros from input.h help some bitfield computations:
These three macros from bitops.h help some bitfield computations:

NBITS(x) - returns the length of a bitfield array in longs for x bits
LONG(x) - returns the index in the array in longs for bit x
BIT(x) - returns the index in a long for bit x
BITS_TO_LONGS(x) - returns the length of a bitfield array in longs for
x bits
BIT_WORD(x) - returns the index in the array in longs for bit x
BIT_MASK(x) - returns the index in a long for bit x

1.5 The id* and name fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,18 @@ static int acpi_button_add(struct acpi_device *device)
switch (button->type) {
case ACPI_BUTTON_TYPE_POWER:
case ACPI_BUTTON_TYPE_POWERF:
input->evbit[0] = BIT(EV_KEY);
input->evbit[0] = BIT_MASK(EV_KEY);
set_bit(KEY_POWER, input->keybit);
break;

case ACPI_BUTTON_TYPE_SLEEP:
case ACPI_BUTTON_TYPE_SLEEPF:
input->evbit[0] = BIT(EV_KEY);
input->evbit[0] = BIT_MASK(EV_KEY);
set_bit(KEY_SLEEP, input->keybit);
break;

case ACPI_BUTTON_TYPE_LID:
input->evbit[0] = BIT(EV_SW);
input->evbit[0] = BIT_MASK(EV_SW);
set_bit(SW_LID, input->swbit);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int shift_state = 0;
*/

static struct input_handler kbd_handler;
static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */
static unsigned long key_down[BITS_TO_LONGS(KEY_CNT)]; /* keyboard key bitmap */
static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */
static int dead_key_next;
static int npadch = -1; /* -1 or number assembled on pad */
Expand Down Expand Up @@ -1377,12 +1377,12 @@ static void kbd_start(struct input_handle *handle)
static const struct input_device_id kbd_ids[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_KEY) },
.evbit = { BIT_MASK(EV_KEY) },
},

{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_SND) },
.evbit = { BIT_MASK(EV_SND) },
},

{ }, /* Terminating entry */
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/sonypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,9 +1178,9 @@ static int __devinit sonypi_create_input_devices(void)
jog_dev->id.bustype = BUS_ISA;
jog_dev->id.vendor = PCI_VENDOR_ID_SONY;

jog_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
jog_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_MIDDLE);
jog_dev->relbit[0] = BIT(REL_WHEEL);
jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
jog_dev->relbit[0] = BIT_MASK(REL_WHEEL);

sonypi_device.input_key_dev = key_dev = input_allocate_device();
if (!key_dev) {
Expand All @@ -1193,7 +1193,7 @@ static int __devinit sonypi_create_input_devices(void)
key_dev->id.vendor = PCI_VENDOR_ID_SONY;

/* Initialize the Input Drivers: special keys */
key_dev->evbit[0] = BIT(EV_KEY);
key_dev->evbit[0] = BIT_MASK(EV_KEY);
for (i = 0; sonypi_inputkeys[i].sonypiev; i++)
if (sonypi_inputkeys[i].inputev)
set_bit(sonypi_inputkeys[i].inputev, key_dev->keybit);
Expand Down
3 changes: 2 additions & 1 deletion drivers/firmware/dcdbas.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
#define _DCDBAS_H_

#include <linux/device.h>
#include <linux/input.h>
#include <linux/sysfs.h>
#include <linux/types.h>

#define BIT(x) (1UL << x)

#define MAX_SMI_DATA_BUF_SIZE (256 * 1024)

#define HC_ACTION_NONE (0)
Expand Down
7 changes: 5 additions & 2 deletions drivers/hid/usbhid/usbkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,11 @@ static int usb_kbd_probe(struct usb_interface *iface,

input_set_drvdata(input_dev, kbd);

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) |
BIT_MASK(EV_REP);
input_dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) |
BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_COMPOSE) |
BIT_MASK(LED_KANA);

for (i = 0; i < 255; i++)
set_bit(usb_kbd_keycode[i], input_dev->keybit);
Expand Down
12 changes: 7 additions & 5 deletions drivers/hid/usbhid/usbmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,13 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
usb_to_input_id(dev, &input_dev->id);
input_dev->dev.parent = &intf->dev;

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
input_dev->relbit[0] |= BIT(REL_WHEEL);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) |
BIT_MASK(BTN_EXTRA);
input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);

input_set_drvdata(input_dev, mouse);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ static int applesmc_create_accelerometer(void)
idev->name = "applesmc";
idev->id.bustype = BUS_HOST;
idev->dev.parent = &pdev->dev;
idev->evbit[0] = BIT(EV_ABS);
idev->evbit[0] = BIT_MASK(EV_ABS);
input_set_abs_params(idev, ABS_X,
-256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT);
input_set_abs_params(idev, ABS_Y,
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/hdaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static int __init hdaps_init(void)
idev = hdaps_idev->input;
idev->name = "hdaps";
idev->dev.parent = &pdev->dev;
idev->evbit[0] = BIT(EV_ABS);
idev->evbit[0] = BIT_MASK(EV_ABS);
input_set_abs_params(idev, ABS_X,
-256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
input_set_abs_params(idev, ABS_Y,
Expand Down
12 changes: 6 additions & 6 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait)
#ifdef CONFIG_COMPAT

#define BITS_PER_LONG_COMPAT (sizeof(compat_long_t) * 8)
#define NBITS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1)
#define BITS_TO_LONGS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1)

#ifdef __BIG_ENDIAN
static int bits_to_user(unsigned long *bits, unsigned int maxbit,
Expand All @@ -504,7 +504,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit,
int len, i;

if (compat) {
len = NBITS_COMPAT(maxbit) * sizeof(compat_long_t);
len = BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t);
if (len > maxlen)
len = maxlen;

Expand All @@ -515,7 +515,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit,
sizeof(compat_long_t)))
return -EFAULT;
} else {
len = NBITS(maxbit) * sizeof(long);
len = BITS_TO_LONGS(maxbit) * sizeof(long);
if (len > maxlen)
len = maxlen;

Expand All @@ -530,8 +530,8 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit,
unsigned int maxlen, void __user *p, int compat)
{
int len = compat ?
NBITS_COMPAT(maxbit) * sizeof(compat_long_t) :
NBITS(maxbit) * sizeof(long);
BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t) :
BITS_TO_LONGS(maxbit) * sizeof(long);

if (len > maxlen)
len = maxlen;
Expand All @@ -545,7 +545,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit,
static int bits_to_user(unsigned long *bits, unsigned int maxbit,
unsigned int maxlen, void __user *p, int compat)
{
int len = NBITS(maxbit) * sizeof(long);
int len = BITS_TO_LONGS(maxbit) * sizeof(long);

if (len > maxlen)
len = maxlen;
Expand Down
10 changes: 5 additions & 5 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,10 @@ static int input_default_setkeycode(struct input_dev *dev,


#define MATCH_BIT(bit, max) \
for (i = 0; i < NBITS(max); i++) \
for (i = 0; i < BITS_TO_LONGS(max); i++) \
if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \
break; \
if (i != NBITS(max)) \
if (i != BITS_TO_LONGS(max)) \
continue;

static const struct input_device_id *input_match_device(const struct input_device_id *id,
Expand Down Expand Up @@ -698,7 +698,7 @@ static void input_seq_print_bitmap(struct seq_file *seq, const char *name,
{
int i;

for (i = NBITS(max) - 1; i > 0; i--)
for (i = BITS_TO_LONGS(max) - 1; i > 0; i--)
if (bitmap[i])
break;

Expand Down Expand Up @@ -892,7 +892,7 @@ static int input_print_modalias_bits(char *buf, int size,

len += snprintf(buf, max(size, 0), "%c", name);
for (i = min_bit; i < max_bit; i++)
if (bm[LONG(i)] & BIT(i))
if (bm[BIT_WORD(i)] & BIT_MASK(i))
len += snprintf(buf + len, max(size - len, 0), "%X,", i);
return len;
}
Expand Down Expand Up @@ -991,7 +991,7 @@ static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap,
int i;
int len = 0;

for (i = NBITS(max) - 1; i > 0; i--)
for (i = BITS_TO_LONGS(max) - 1; i > 0; i--)
if (bitmap[i])
break;

Expand Down
16 changes: 8 additions & 8 deletions drivers/input/joydev.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ static const struct input_device_id joydev_blacklist[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT(EV_KEY) },
.keybit = { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) },
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
}, /* Avoid itouchpads, touchscreens and tablets */
{ } /* Terminating entry */
};
Expand All @@ -854,20 +854,20 @@ static const struct input_device_id joydev_ids[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_X) },
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_X) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_WHEEL) },
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_WHEEL) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_THROTTLE) },
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_THROTTLE) },
},
{ } /* Terminating entry */
};
Expand Down
28 changes: 17 additions & 11 deletions drivers/input/joystick/a3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,19 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)

a3d->length = 33;

input_dev->evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL);
input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y);
input_dev->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER)
| BIT(ABS_HAT0X) | BIT(ABS_HAT0Y) | BIT(ABS_HAT1X) | BIT(ABS_HAT1Y);
input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE)
| BIT(BTN_SIDE) | BIT(BTN_EXTRA);
input_dev->keybit[LONG(BTN_JOYSTICK)] |= BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP)
| BIT(BTN_PINKIE);
input_dev->evbit[0] |= BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY) |
BIT_MASK(EV_REL);
input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
BIT_MASK(ABS_THROTTLE) | BIT_MASK(ABS_RUDDER) |
BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) |
BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y);
input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) |
BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
input_dev->keybit[BIT_WORD(BTN_JOYSTICK)] |=
BIT_MASK(BTN_TRIGGER) | BIT_MASK(BTN_THUMB) |
BIT_MASK(BTN_TOP) | BIT_MASK(BTN_PINKIE);

a3d_read(a3d, data);

Expand All @@ -348,9 +353,10 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)
} else {
a3d->length = 29;

input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_REL);
input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y);
input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE);
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE);

a3d_read(a3d, data);

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/adi.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int adi_init_input(struct adi *adi, struct adi_port *port, int half)
input_dev->open = adi_open;
input_dev->close = adi_close;

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);

for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++)
set_bit(adi->abs[i], input_dev->absbit);
Expand Down
7 changes: 4 additions & 3 deletions drivers/input/joystick/amijoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ static int __init amijoy_init(void)
amijoy_dev[i]->open = amijoy_open;
amijoy_dev[i]->close = amijoy_close;

amijoy_dev[i]->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
amijoy_dev[i]->absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
amijoy_dev[i]->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
amijoy_dev[i]->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
amijoy_dev[i]->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
amijoy_dev[i]->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
for (j = 0; j < 2; j++) {
amijoy_dev[i]->absmin[ABS_X + j] = -1;
amijoy_dev[i]->absmax[ABS_X + j] = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i
input_dev->open = analog_open;
input_dev->close = analog_close;

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);

for (i = j = 0; i < 4; i++)
if (analog->mask & (1 << i)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/cobra.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
input_dev->open = cobra_open;
input_dev->close = cobra_close;

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0);
input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0);
for (j = 0; cobra_btn[j]; j++)
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/db9.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ static struct db9 __init *db9_probe(int parport, int mode)
input_dev->open = db9_open;
input_dev->close = db9_close;

input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
for (j = 0; j < db9_mode->n_buttons; j++)
set_bit(db9_mode->buttons[j], input_dev->keybit);
for (j = 0; j < db9_mode->n_axis; j++) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
input_dev->close = gc_close;

if (pad_type != GC_SNESMOUSE) {
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);

for (i = 0; i < 2; i++)
input_set_abs_params(input_dev, ABS_X + i, -1, 1, 0, 0);
} else
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);

gc->pads[0] |= gc_status_bit[idx];
gc->pads[pad_type] |= gc_status_bit[idx];
Expand Down
Loading

0 comments on commit 7b19ada

Please sign in to comment.