diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-10-19 02:40:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:42 -0400 |
commit | 7b19ada2ed3c1eccb9fe94d74b05e1428224663d (patch) | |
tree | a0c5975ce5236ff4023b92d431bd0a8fa321c6ce /drivers/input/tablet | |
parent | d05be13bcc6ec615fb2e9556a9b85d52800669b6 (diff) |
get rid of input BIT* duplicate defines
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 <jirislaby@gmail.com>
Cc: <dtor@mail.ru>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: <lenb@kernel.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: <perex@suse.cz>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <vernux@us.ibm.com>
Cc: <malattia@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/acecad.c | 12 | ||||
-rw-r--r-- | drivers/input/tablet/gtco.c | 6 | ||||
-rw-r--r-- | drivers/input/tablet/kbtab.c | 11 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 58 |
4 files changed, 54 insertions, 33 deletions
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index dd2310458c46..b973d0ef6d16 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c | |||
@@ -192,10 +192,14 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
192 | input_dev->open = usb_acecad_open; | 192 | input_dev->open = usb_acecad_open; |
193 | input_dev->close = usb_acecad_close; | 193 | input_dev->close = usb_acecad_close; |
194 | 194 | ||
195 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | 195 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
196 | input_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE); | 196 | input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | |
197 | input_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); | 197 | BIT_MASK(ABS_PRESSURE); |
198 | input_dev->keybit[LONG(BTN_DIGI)] = BIT(BTN_TOOL_PEN) |BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2); | 198 | input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | |
199 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); | ||
200 | input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) | | ||
201 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) | | ||
202 | BIT_MASK(BTN_STYLUS2); | ||
199 | 203 | ||
200 | switch (id->driver_info) { | 204 | switch (id->driver_info) { |
201 | case 0: | 205 | case 0: |
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index b2ca10f2fe0e..d2c6da264722 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c | |||
@@ -573,10 +573,12 @@ static void gtco_setup_caps(struct input_dev *inputdev) | |||
573 | struct gtco *device = input_get_drvdata(inputdev); | 573 | struct gtco *device = input_get_drvdata(inputdev); |
574 | 574 | ||
575 | /* Which events */ | 575 | /* Which events */ |
576 | inputdev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC); | 576 | inputdev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | |
577 | BIT_MASK(EV_MSC); | ||
577 | 578 | ||
578 | /* Misc event menu block */ | 579 | /* Misc event menu block */ |
579 | inputdev->mscbit[0] = BIT(MSC_SCAN)|BIT(MSC_SERIAL)|BIT(MSC_RAW) ; | 580 | inputdev->mscbit[0] = BIT_MASK(MSC_SCAN) | BIT_MASK(MSC_SERIAL) | |
581 | BIT_MASK(MSC_RAW); | ||
580 | 582 | ||
581 | /* Absolute values based on HID report info */ | 583 | /* Absolute values based on HID report info */ |
582 | input_set_abs_params(inputdev, ABS_X, device->min_X, device->max_X, | 584 | input_set_abs_params(inputdev, ABS_X, device->min_X, device->max_X, |
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 91e6d00d4a43..1182fc133167 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c | |||
@@ -153,10 +153,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
153 | input_dev->open = kbtab_open; | 153 | input_dev->open = kbtab_open; |
154 | input_dev->close = kbtab_close; | 154 | input_dev->close = kbtab_close; |
155 | 155 | ||
156 | input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC); | 156 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | |
157 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); | 157 | BIT_MASK(EV_MSC); |
158 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); | 158 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | |
159 | input_dev->mscbit[0] |= BIT(MSC_SERIAL); | 159 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); |
160 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | | ||
161 | BIT_MASK(BTN_TOUCH); | ||
162 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); | ||
160 | input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); | 163 | input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); |
161 | input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); | 164 | input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); |
162 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); | 165 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 064e123c9b76..d64b1ea136b3 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -140,48 +140,58 @@ static void wacom_close(struct input_dev *dev) | |||
140 | 140 | ||
141 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 141 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
142 | { | 142 | { |
143 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_1) | BIT(BTN_5); | 143 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) | |
144 | BIT_MASK(BTN_5); | ||
144 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); | 145 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
145 | } | 146 | } |
146 | 147 | ||
147 | void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 148 | void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
148 | { | 149 | { |
149 | input_dev->evbit[0] |= BIT(EV_MSC); | 150 | input_dev->evbit[0] |= BIT_MASK(EV_MSC); |
150 | input_dev->mscbit[0] |= BIT(MSC_SERIAL); | 151 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
151 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); | 152 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
152 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_4); | 153 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | |
154 | BIT_MASK(BTN_4); | ||
153 | } | 155 | } |
154 | 156 | ||
155 | void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 157 | void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
156 | { | 158 | { |
157 | input_dev->evbit[0] |= BIT(EV_REL); | 159 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
158 | input_dev->relbit[0] |= BIT(REL_WHEEL); | 160 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
159 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); | 161 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | |
160 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2); | 162 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); |
163 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | ||
164 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); | ||
161 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); | 165 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); |
162 | } | 166 | } |
163 | 167 | ||
164 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 168 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
165 | { | 169 | { |
166 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); | 170 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
167 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3); | 171 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | |
172 | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); | ||
168 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); | 173 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
169 | } | 174 | } |
170 | 175 | ||
171 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 176 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
172 | { | 177 | { |
173 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); | 178 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) | |
179 | BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); | ||
174 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); | 180 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
175 | } | 181 | } |
176 | 182 | ||
177 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 183 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
178 | { | 184 | { |
179 | input_dev->evbit[0] |= BIT(EV_MSC) | BIT(EV_REL); | 185 | input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); |
180 | input_dev->mscbit[0] |= BIT(MSC_SERIAL); | 186 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
181 | input_dev->relbit[0] |= BIT(REL_WHEEL); | 187 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
182 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); | 188 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | |
183 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) | 189 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | |
184 | | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2); | 190 | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); |
191 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | ||
192 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_TOOL_BRUSH) | | ||
193 | BIT_MASK(BTN_TOOL_PENCIL) | BIT_MASK(BTN_TOOL_AIRBRUSH) | | ||
194 | BIT_MASK(BTN_TOOL_LENS) | BIT_MASK(BTN_STYLUS2); | ||
185 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); | 195 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); |
186 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); | 196 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); |
187 | input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); | 197 | input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); |
@@ -192,12 +202,13 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
192 | 202 | ||
193 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 203 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
194 | { | 204 | { |
195 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER); | 205 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) | |
206 | BIT_MASK(BTN_TOOL_RUBBER); | ||
196 | } | 207 | } |
197 | 208 | ||
198 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 209 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
199 | { | 210 | { |
200 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER); | 211 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); |
201 | } | 212 | } |
202 | 213 | ||
203 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) | 214 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) |
@@ -243,12 +254,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
243 | input_dev->open = wacom_open; | 254 | input_dev->open = wacom_open; |
244 | input_dev->close = wacom_close; | 255 | input_dev->close = wacom_close; |
245 | 256 | ||
246 | input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); | 257 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
247 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); | 258 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | |
259 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); | ||
248 | input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); | 260 | input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); |
249 | input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); | 261 | input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); |
250 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); | 262 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); |
251 | input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC); | 263 | input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); |
252 | 264 | ||
253 | wacom_init_input_dev(input_dev, wacom_wac); | 265 | wacom_init_input_dev(input_dev, wacom_wac); |
254 | 266 | ||