Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af0c859a authored by Chetan C R's avatar Chetan C R Committed by Chetan C R
Browse files

msm: keypad: fix matrix column scan issue on msm8905 qrd



When 2 keys are pressed together on matrix keypad all
keys in the column are getting identified. This fixes
column scan issue and report only proper keys which
are pressed.

Change-Id: I39b8ef0b52ecffd20fa9ab50f958b1a0b7f34855
Signed-off-by: default avatarChetan C R <cravin@codeaurora.org>
parent 0ca7a05c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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);
@@ -137,9 +137,14 @@ static void matrix_keypad_scan(struct work_struct *work)
			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;

@@ -162,6 +167,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 */