Re: [PATCH] input: keyboard: tegra: support for defining row/columns based on SoC
From: Stephen Warren <hidden>
Date: 2013-03-12 18:09:32
Also in:
linux-tegra, lkml
From: Stephen Warren <hidden>
Date: 2013-03-12 18:09:32
Also in:
linux-tegra, lkml
On 03/12/2013 05:36 AM, Laxman Dewangan wrote:
NVIDIA's Tegra20 and Tegra30 supports the 16x8 keyboard matrix and T114 support the 11x8 Key matrix. Add support for defining the maximum row/columns based on SoC through proper compatibity.
Aside from the few nits below, Reviewed-by: Stephen Warren <redacted>
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
@@ -108,6 +115,9 @@ struct tegra_kbc { u32 wakeup_key; struct timer_list timer; struct clk *clk; + const struct tegra_kbc_hw_support *hw_support; + int max_keys; + int max_row_columns;
That isn't really max_row_columns, that's num_gpios or perhaps num_rows_and_columns.
+ if (num_cols > kbc->hw_support->max_columns) {
+ dev_err(kbc->dev,
+ "Number of column is more than supported on SoCs\n");That's be slightly better as: Number of columns is more than supported by this hardware. Similar for the row check above.
@@ -579,6 +622,12 @@ static int tegra_kbc_probe(struct platform_device *pdev) } kbc->dev = &pdev->dev; + kbc->hw_support = match->data; + kbc->max_keys = (kbc->hw_support->max_rows * + kbc->hw_support->max_columns); + kbc->max_row_columns = (kbc->hw_support->max_rows + + kbc->hw_support->max_columns);
You don't need the () around either of those expressions.