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

Commit 57f43ca2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: keypad: fix matrix row/column scan issue on msm8905 qrd"

parents d8c2ee3c 34252a43
Loading
Loading
Loading
Loading
+13 −5
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);
@@ -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;

@@ -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 */