Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: matrix_keypad - make matrix keymap size dynamic
Input: wistron_btns - support Prestigio Wifi RF kill button
Input: i8042 - add Asus G1S to noloop exception list

+40 -15
+9 -9
drivers/input/keyboard/matrix_keypad.c
··· 27 const struct matrix_keypad_platform_data *pdata; 28 struct input_dev *input_dev; 29 unsigned short *keycodes; 30 31 uint32_t last_key_state[MATRIX_MAX_COLS]; 32 struct delayed_work work; ··· 137 if ((bits_changed & (1 << row)) == 0) 138 continue; 139 140 - code = (row << 4) + col; 141 input_event(input_dev, EV_MSC, MSC_SCAN, code); 142 input_report_key(input_dev, 143 keypad->keycodes[code], ··· 318 struct matrix_keypad *keypad; 319 struct input_dev *input_dev; 320 unsigned short *keycodes; 321 int i; 322 int err; 323 ··· 334 return -EINVAL; 335 } 336 337 - if (!keymap_data->max_keymap_size) { 338 - dev_err(&pdev->dev, "invalid keymap data supplied\n"); 339 - return -EINVAL; 340 - } 341 342 keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); 343 - keycodes = kzalloc(keymap_data->max_keymap_size * 344 - sizeof(keypad->keycodes), 345 GFP_KERNEL); 346 input_dev = input_allocate_device(); 347 if (!keypad || !keycodes || !input_dev) { ··· 349 keypad->input_dev = input_dev; 350 keypad->pdata = pdata; 351 keypad->keycodes = keycodes; 352 keypad->stopped = true; 353 INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); 354 spin_lock_init(&keypad->lock); ··· 363 364 input_dev->keycode = keycodes; 365 input_dev->keycodesize = sizeof(*keycodes); 366 - input_dev->keycodemax = keymap_data->max_keymap_size; 367 368 for (i = 0; i < keymap_data->keymap_size; i++) { 369 unsigned int key = keymap_data->keymap[i]; ··· 371 unsigned int col = KEY_COL(key); 372 unsigned short code = KEY_VAL(key); 373 374 - keycodes[(row << 4) + col] = code; 375 __set_bit(code, input_dev->keybit); 376 } 377 __clear_bit(KEY_RESERVED, input_dev->keybit);
··· 27 const struct matrix_keypad_platform_data *pdata; 28 struct input_dev *input_dev; 29 unsigned short *keycodes; 30 + unsigned int row_shift; 31 32 uint32_t last_key_state[MATRIX_MAX_COLS]; 33 struct delayed_work work; ··· 136 if ((bits_changed & (1 << row)) == 0) 137 continue; 138 139 + code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); 140 input_event(input_dev, EV_MSC, MSC_SCAN, code); 141 input_report_key(input_dev, 142 keypad->keycodes[code], ··· 317 struct matrix_keypad *keypad; 318 struct input_dev *input_dev; 319 unsigned short *keycodes; 320 + unsigned int row_shift; 321 int i; 322 int err; 323 ··· 332 return -EINVAL; 333 } 334 335 + row_shift = get_count_order(pdata->num_col_gpios); 336 337 keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); 338 + keycodes = kzalloc((pdata->num_row_gpios << row_shift) * 339 + sizeof(*keycodes), 340 GFP_KERNEL); 341 input_dev = input_allocate_device(); 342 if (!keypad || !keycodes || !input_dev) { ··· 350 keypad->input_dev = input_dev; 351 keypad->pdata = pdata; 352 keypad->keycodes = keycodes; 353 + keypad->row_shift = row_shift; 354 keypad->stopped = true; 355 INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); 356 spin_lock_init(&keypad->lock); ··· 363 364 input_dev->keycode = keycodes; 365 input_dev->keycodesize = sizeof(*keycodes); 366 + input_dev->keycodemax = pdata->num_row_gpios << keypad->row_shift; 367 368 for (i = 0; i < keymap_data->keymap_size; i++) { 369 unsigned int key = keymap_data->keymap[i]; ··· 371 unsigned int col = KEY_COL(key); 372 unsigned short code = KEY_VAL(key); 373 374 + keycodes[MATRIX_SCAN_CODE(row, col, row_shift)] = code; 375 __set_bit(code, input_dev->keybit); 376 } 377 __clear_bit(KEY_RESERVED, input_dev->keybit);
+16
drivers/input/misc/wistron_btns.c
··· 611 { KE_END, 0 } 612 }; 613 614 /* 615 * If your machine is not here (which is currently rather likely), please send 616 * a list of buttons and their key codes (reported when loading this module ··· 985 if (keymap_name != NULL) { 986 if (strcmp (keymap_name, "1557/MS2141") == 0) 987 keymap = keymap_wistron_ms2141; 988 else if (strcmp (keymap_name, "generic") == 0) 989 keymap = keymap_wistron_generic; 990 else {
··· 611 { KE_END, 0 } 612 }; 613 614 + static struct key_entry keymap_prestigio[] __initdata = { 615 + { KE_KEY, 0x11, {KEY_PROG1} }, 616 + { KE_KEY, 0x12, {KEY_PROG2} }, 617 + { KE_WIFI, 0x30 }, 618 + { KE_KEY, 0x22, {KEY_REWIND} }, 619 + { KE_KEY, 0x23, {KEY_FORWARD} }, 620 + { KE_KEY, 0x24, {KEY_PLAYPAUSE} }, 621 + { KE_KEY, 0x25, {KEY_STOPCD} }, 622 + { KE_KEY, 0x31, {KEY_MAIL} }, 623 + { KE_KEY, 0x36, {KEY_WWW} }, 624 + { KE_END, 0 } 625 + }; 626 + 627 + 628 /* 629 * If your machine is not here (which is currently rather likely), please send 630 * a list of buttons and their key codes (reported when loading this module ··· 971 if (keymap_name != NULL) { 972 if (strcmp (keymap_name, "1557/MS2141") == 0) 973 keymap = keymap_wistron_ms2141; 974 + else if (strcmp (keymap_name, "prestigio") == 0) 975 + keymap = keymap_prestigio; 976 else if (strcmp (keymap_name, "generic") == 0) 977 keymap = keymap_wistron_generic; 978 else {
+8
drivers/input/serio/i8042-x86ia64io.h
··· 78 }, 79 }, 80 { 81 /* AUX LOOP command does not raise AUX IRQ */ 82 .ident = "ASUS P65UP5", 83 .matches = {
··· 78 }, 79 }, 80 { 81 + .ident = "ASUS G1S", 82 + .matches = { 83 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."), 84 + DMI_MATCH(DMI_BOARD_NAME, "G1S"), 85 + DMI_MATCH(DMI_BOARD_VERSION, "1.0"), 86 + }, 87 + }, 88 + { 89 /* AUX LOOP command does not raise AUX IRQ */ 90 .ident = "ASUS P65UP5", 91 .matches = {
+7 -6
include/linux/input/matrix_keypad.h
··· 15 #define KEY_COL(k) (((k) >> 16) & 0xff) 16 #define KEY_VAL(k) ((k) & 0xffff) 17 18 /** 19 * struct matrix_keymap_data - keymap for matrix keyboards 20 * @keymap: pointer to array of uint32 values encoded with KEY() macro 21 * representing keymap 22 * @keymap_size: number of entries (initialized) in this keymap 23 - * @max_keymap_size: maximum size of keymap supported by the device 24 * 25 * This structure is supposed to be used by platform code to supply 26 * keymaps to drivers that implement matrix-like keypads/keyboards. ··· 29 struct matrix_keymap_data { 30 const uint32_t *keymap; 31 unsigned int keymap_size; 32 - unsigned int max_keymap_size; 33 }; 34 35 /** 36 * struct matrix_keypad_platform_data - platform-dependent keypad data 37 * @keymap_data: pointer to &matrix_keymap_data 38 - * @row_gpios: array of gpio numbers reporesenting rows 39 - * @col_gpios: array of gpio numbers reporesenting colums 40 * @num_row_gpios: actual number of row gpios used by device 41 * @num_col_gpios: actual number of col gpios used by device 42 * @col_scan_delay_us: delay, measured in microseconds, that is ··· 48 struct matrix_keypad_platform_data { 49 const struct matrix_keymap_data *keymap_data; 50 51 - unsigned int row_gpios[MATRIX_MAX_ROWS]; 52 - unsigned int col_gpios[MATRIX_MAX_COLS]; 53 unsigned int num_row_gpios; 54 unsigned int num_col_gpios; 55
··· 15 #define KEY_COL(k) (((k) >> 16) & 0xff) 16 #define KEY_VAL(k) ((k) & 0xffff) 17 18 + #define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col)) 19 + 20 /** 21 * struct matrix_keymap_data - keymap for matrix keyboards 22 * @keymap: pointer to array of uint32 values encoded with KEY() macro 23 * representing keymap 24 * @keymap_size: number of entries (initialized) in this keymap 25 * 26 * This structure is supposed to be used by platform code to supply 27 * keymaps to drivers that implement matrix-like keypads/keyboards. ··· 28 struct matrix_keymap_data { 29 const uint32_t *keymap; 30 unsigned int keymap_size; 31 }; 32 33 /** 34 * struct matrix_keypad_platform_data - platform-dependent keypad data 35 * @keymap_data: pointer to &matrix_keymap_data 36 + * @row_gpios: pointer to array of gpio numbers representing rows 37 + * @col_gpios: pointer to array of gpio numbers reporesenting colums 38 * @num_row_gpios: actual number of row gpios used by device 39 * @num_col_gpios: actual number of col gpios used by device 40 * @col_scan_delay_us: delay, measured in microseconds, that is ··· 48 struct matrix_keypad_platform_data { 49 const struct matrix_keymap_data *keymap_data; 50 51 + const unsigned int *row_gpios; 52 + const unsigned int *col_gpios; 53 + 54 unsigned int num_row_gpios; 55 unsigned int num_col_gpios; 56