[PATCH v1 12/12] input: matrix-keypad: add diagnostics in probe()

Gerhard Sittig gsi at denx.de
Sat Jun 22 04:09:58 EST 2013


optionally dump relevant configuration of pins, matrix lines,
and delay/interval times at the very end of the probe routine
(development feature, silent by default)

Signed-off-by: Gerhard Sittig <gsi at denx.de>
---
 drivers/input/keyboard/matrix_keypad.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 275b157..69b15720 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -800,6 +800,24 @@ static int matrix_keypad_probe(struct platform_device *pdev)
 	device_init_wakeup(&pdev->dev, pdata->wakeup);
 	platform_set_drvdata(pdev, keypad);
 
+	dev_dbg(&pdev->dev, "gpios col num[%u] lvl[%s] drv[%s] enc[%s]\n",
+		pdata->num_col_gpios,
+		pdata->col_gpios_active_low ? "low" : "high",
+		pdata->col_gpios_push_pull ? "pp" : "od",
+		pdata->col_gpios_binary_encoded ? "bin" : "1-1");
+	dev_dbg(&pdev->dev, "gpios row num[%u] lvl[%s]\n",
+		pdata->num_row_gpios,
+		pdata->row_gpios_active_low ? "low" : "high");
+	dev_dbg(&pdev->dev, "matrix cols[%u] rows[%u] code shift[%u]\n",
+		pdata->num_matrix_cols,
+		pdata->num_matrix_rows,
+		keypad->row_shift);
+	dev_dbg(&pdev->dev, "times scan[%u-%u] bounce[%u] switch[%u]\n",
+		pdata->col_scan_delay_us,
+		pdata->col_scan_delay_us_max,
+		pdata->debounce_ms,
+		pdata->col_switch_delay_ms);
+
 	return 0;
 
 err_free_gpio:
-- 
1.7.10.4



More information about the devicetree-discuss mailing list