pxa27x_keypad.c (ecd740c6f2f092b90b95fa35f757973589eaaca2) pxa27x_keypad.c (c5ec1948eaab7c1c0f412b2804e65a637f1c7443)
1/*
2 * linux/drivers/input/keyboard/pxa27x_keypad.c
3 *
4 * Driver for the pxa27x matrix keyboard controller.
5 *
6 * Created: Feb 22, 2007
7 * Author: Rodolfo Giometti <giometti@linux.it>
8 *

--- 97 unchanged lines hidden (view full) ---

106 struct input_dev *input_dev;
107 void __iomem *mmio_base;
108
109 int irq;
110
111 unsigned short keycodes[MAX_KEYPAD_KEYS];
112 int rotary_rel_code[2];
113
1/*
2 * linux/drivers/input/keyboard/pxa27x_keypad.c
3 *
4 * Driver for the pxa27x matrix keyboard controller.
5 *
6 * Created: Feb 22, 2007
7 * Author: Rodolfo Giometti <giometti@linux.it>
8 *

--- 97 unchanged lines hidden (view full) ---

106 struct input_dev *input_dev;
107 void __iomem *mmio_base;
108
109 int irq;
110
111 unsigned short keycodes[MAX_KEYPAD_KEYS];
112 int rotary_rel_code[2];
113
114 unsigned int row_shift;
115
114 /* state row bits of each column scan */
115 uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS];
116 uint32_t direct_key_state;
117
118 unsigned int direct_key_mask;
119};
120
121#ifdef CONFIG_OF

--- 340 unchanged lines hidden (view full) ---

462 bits_changed = keypad->matrix_key_state[col] ^ new_state[col];
463 if (bits_changed == 0)
464 continue;
465
466 for (row = 0; row < pdata->matrix_key_rows; row++) {
467 if ((bits_changed & (1 << row)) == 0)
468 continue;
469
116 /* state row bits of each column scan */
117 uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS];
118 uint32_t direct_key_state;
119
120 unsigned int direct_key_mask;
121};
122
123#ifdef CONFIG_OF

--- 340 unchanged lines hidden (view full) ---

464 bits_changed = keypad->matrix_key_state[col] ^ new_state[col];
465 if (bits_changed == 0)
466 continue;
467
468 for (row = 0; row < pdata->matrix_key_rows; row++) {
469 if ((bits_changed & (1 << row)) == 0)
470 continue;
471
470 code = MATRIX_SCAN_CODE(row, col, MATRIX_ROW_SHIFT);
472 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
473
471 input_event(input_dev, EV_MSC, MSC_SCAN, code);
472 input_report_key(input_dev, keypad->keycodes[code],
473 new_state[col] & (1 << row));
474 }
475 }
476 input_sync(input_dev);
477 memcpy(keypad->matrix_key_state, new_state, sizeof(new_state));
478}

--- 318 unchanged lines hidden (view full) ---

797 */
798 pdata = keypad->pdata;
799 }
800 if (error) {
801 dev_err(&pdev->dev, "failed to build keycode\n");
802 goto failed_put_clk;
803 }
804
474 input_event(input_dev, EV_MSC, MSC_SCAN, code);
475 input_report_key(input_dev, keypad->keycodes[code],
476 new_state[col] & (1 << row));
477 }
478 }
479 input_sync(input_dev);
480 memcpy(keypad->matrix_key_state, new_state, sizeof(new_state));
481}

--- 318 unchanged lines hidden (view full) ---

800 */
801 pdata = keypad->pdata;
802 }
803 if (error) {
804 dev_err(&pdev->dev, "failed to build keycode\n");
805 goto failed_put_clk;
806 }
807
808 keypad->row_shift = get_count_order(pdata->matrix_key_cols);
809
805 if ((pdata->enable_rotary0 && keypad->rotary_rel_code[0] != -1) ||
806 (pdata->enable_rotary1 && keypad->rotary_rel_code[1] != -1)) {
807 input_dev->evbit[0] |= BIT_MASK(EV_REL);
808 }
809
810 error = request_irq(irq, pxa27x_keypad_irq_handler, 0,
811 pdev->name, keypad);
812 if (error) {

--- 74 unchanged lines hidden ---
810 if ((pdata->enable_rotary0 && keypad->rotary_rel_code[0] != -1) ||
811 (pdata->enable_rotary1 && keypad->rotary_rel_code[1] != -1)) {
812 input_dev->evbit[0] |= BIT_MASK(EV_REL);
813 }
814
815 error = request_irq(irq, pxa27x_keypad_irq_handler, 0,
816 pdev->name, keypad);
817 if (error) {

--- 74 unchanged lines hidden ---