Loading drivers/input/keyboard/matrix_keypad.c +13 −5 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ static void matrix_keypad_scan(struct work_struct *work) const unsigned short *keycodes = input_dev->keycode; const struct matrix_keypad_platform_data *pdata = keypad->pdata; uint32_t new_state[MATRIX_MAX_COLS]; int row, col, code; int row, col, code, count_state = 0; /* de-activate all columns for scanning */ activate_all_cols(pdata, false); Loading @@ -131,15 +131,22 @@ static void matrix_keypad_scan(struct work_struct *work) /* assert each column and read the row status out */ for (col = 0; col < pdata->num_col_gpios; col++) { for (row = 0; row < pdata->num_row_gpios; row++) { activate_col(pdata, col, true); for (row = 0; row < pdata->num_row_gpios; row++) new_state[col] |= row_asserted(pdata, row) ? (1 << row) : 0; gpio_direction_output(pdata->col_gpios[col], 0); new_state[col] &= row_asserted(pdata, row) ? ~(1 << row) : ~(0); } if (new_state[col]) count_state++; activate_col(pdata, col, false); } if (count_state == 5) goto out; for (col = 0; col < pdata->num_col_gpios; col++) { uint32_t bits_changed; Loading @@ -162,6 +169,7 @@ static void matrix_keypad_scan(struct work_struct *work) memcpy(keypad->last_key_state, new_state, sizeof(new_state)); out: activate_all_cols(pdata, true); /* Enable IRQs again */ Loading Loading
drivers/input/keyboard/matrix_keypad.c +13 −5 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ static void matrix_keypad_scan(struct work_struct *work) const unsigned short *keycodes = input_dev->keycode; const struct matrix_keypad_platform_data *pdata = keypad->pdata; uint32_t new_state[MATRIX_MAX_COLS]; int row, col, code; int row, col, code, count_state = 0; /* de-activate all columns for scanning */ activate_all_cols(pdata, false); Loading @@ -131,15 +131,22 @@ static void matrix_keypad_scan(struct work_struct *work) /* assert each column and read the row status out */ for (col = 0; col < pdata->num_col_gpios; col++) { for (row = 0; row < pdata->num_row_gpios; row++) { activate_col(pdata, col, true); for (row = 0; row < pdata->num_row_gpios; row++) new_state[col] |= row_asserted(pdata, row) ? (1 << row) : 0; gpio_direction_output(pdata->col_gpios[col], 0); new_state[col] &= row_asserted(pdata, row) ? ~(1 << row) : ~(0); } if (new_state[col]) count_state++; activate_col(pdata, col, false); } if (count_state == 5) goto out; for (col = 0; col < pdata->num_col_gpios; col++) { uint32_t bits_changed; Loading @@ -162,6 +169,7 @@ static void matrix_keypad_scan(struct work_struct *work) memcpy(keypad->last_key_state, new_state, sizeof(new_state)); out: activate_all_cols(pdata, true); /* Enable IRQs again */ Loading