diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-05-16 05:49:18 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-10-14 17:50:49 -0400 |
commit | 022e8c4d08b3b06361594b60412db0242035c4b4 (patch) | |
tree | 9a8c57a3054737fb142054d146bad99723cd3cfa /drivers/hid/hid-input.c | |
parent | 990436a7c9d0e5d395b83d79cfa32f89b8144e5b (diff) |
HID: move usage input mapping to hid.h
This mapping are currently used on 2 placces and will be needed by more
quirk drivers, so move them to hid.h to allow them to use it.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 9fa7239ab310..be2c7a8ad254 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -76,13 +76,15 @@ static const struct { | |||
76 | __s32 y; | 76 | __s32 y; |
77 | } hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}}; | 77 | } hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}}; |
78 | 78 | ||
79 | #define map_abs(c) do { usage->code = c; usage->type = EV_ABS; bit = input->absbit; max = ABS_MAX; } while (0) | 79 | #define map_abs(c) hid_map_usage(hidinput, usage, &bit, &max, EV_ABS, (c)) |
80 | #define map_rel(c) do { usage->code = c; usage->type = EV_REL; bit = input->relbit; max = REL_MAX; } while (0) | 80 | #define map_rel(c) hid_map_usage(hidinput, usage, &bit, &max, EV_REL, (c)) |
81 | #define map_key(c) do { usage->code = c; usage->type = EV_KEY; bit = input->keybit; max = KEY_MAX; } while (0) | 81 | #define map_key(c) hid_map_usage(hidinput, usage, &bit, &max, EV_KEY, (c)) |
82 | #define map_led(c) do { usage->code = c; usage->type = EV_LED; bit = input->ledbit; max = LED_MAX; } while (0) | 82 | #define map_led(c) hid_map_usage(hidinput, usage, &bit, &max, EV_LED, (c)) |
83 | 83 | ||
84 | #define map_abs_clear(c) do { map_abs(c); clear_bit(c, bit); } while (0) | 84 | #define map_abs_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ |
85 | #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) | 85 | &max, EV_ABS, (c)) |
86 | #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ | ||
87 | &max, EV_KEY, (c)) | ||
86 | 88 | ||
87 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | 89 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK |
88 | 90 | ||
@@ -386,7 +388,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
386 | } | 388 | } |
387 | 389 | ||
388 | /* handle input mappings for quirky devices */ | 390 | /* handle input mappings for quirky devices */ |
389 | ret = hidinput_mapping_quirks(usage, input, &bit, &max); | 391 | ret = hidinput_mapping_quirks(usage, hidinput, &bit, &max); |
390 | if (ret) | 392 | if (ret) |
391 | goto mapped; | 393 | goto mapped; |
392 | 394 | ||