diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-08-02 23:15:17 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-08-02 23:29:56 -0400 |
commit | 987a6c0298260b7aa40702b349282554d6180e4b (patch) | |
tree | 29d0873435221a6d731267efc2412814440e4a28 /drivers/input/keyboard/hil_kbd.c | |
parent | 7957e9c4d175cc065f4277211fcb7d784fcee860 (diff) |
Input: switch to input_abs_*() access functions
Change all call sites in drivers/input to not access the ABS axis
information directly anymore. Make them use the access helpers instead.
Also use input_set_abs_params() when possible.
Did some code refactoring as I was on it.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/hil_kbd.c')
-rw-r--r-- | drivers/input/keyboard/hil_kbd.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index c83f4b2ec7d3..ddd5afd301d4 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c | |||
@@ -232,15 +232,16 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr) | |||
232 | if (absdev) { | 232 | if (absdev) { |
233 | val = lo + (hi << 8); | 233 | val = lo + (hi << 8); |
234 | #ifdef TABLET_AUTOADJUST | 234 | #ifdef TABLET_AUTOADJUST |
235 | if (val < dev->absmin[ABS_X + i]) | 235 | if (val < input_abs_min(dev, ABS_X + i)) |
236 | dev->absmin[ABS_X + i] = val; | 236 | input_abs_set_min(dev, ABS_X + i, val); |
237 | if (val > dev->absmax[ABS_X + i]) | 237 | if (val > input_abs_max(dev, ABS_X + i)) |
238 | dev->absmax[ABS_X + i] = val; | 238 | XXinput_abs_set_max(dev, ABS_X + i, val); |
239 | #endif | 239 | #endif |
240 | if (i%3) val = dev->absmax[ABS_X + i] - val; | 240 | if (i % 3) |
241 | val = input_abs_max(dev, ABS_X + i) - val; | ||
241 | input_report_abs(dev, ABS_X + i, val); | 242 | input_report_abs(dev, ABS_X + i, val); |
242 | } else { | 243 | } else { |
243 | val = (int) (((int8_t)lo) | ((int8_t)hi << 8)); | 244 | val = (int) (((int8_t) lo) | ((int8_t) hi << 8)); |
244 | if (i % 3) | 245 | if (i % 3) |
245 | val *= -1; | 246 | val *= -1; |
246 | input_report_rel(dev, REL_X + i, val); | 247 | input_report_rel(dev, REL_X + i, val); |
@@ -387,9 +388,11 @@ static void hil_dev_pointer_setup(struct hil_dev *ptr) | |||
387 | 388 | ||
388 | #ifdef TABLET_AUTOADJUST | 389 | #ifdef TABLET_AUTOADJUST |
389 | for (i = 0; i < ABS_MAX; i++) { | 390 | for (i = 0; i < ABS_MAX; i++) { |
390 | int diff = input_dev->absmax[ABS_X + i] / 10; | 391 | int diff = input_abs_max(input_dev, ABS_X + i) / 10; |
391 | input_dev->absmin[ABS_X + i] += diff; | 392 | input_abs_set_min(input_dev, ABS_X + i, |
392 | input_dev->absmax[ABS_X + i] -= diff; | 393 | input_abs_min(input_dev, ABS_X + i) + diff) |
394 | XXinput_abs_set_max(input_dev, ABS_X + i, | ||
395 | input_abs_max(input_dev, ABS_X + i) - diff) | ||
393 | } | 396 | } |
394 | #endif | 397 | #endif |
395 | 398 | ||