diff options
Diffstat (limited to 'drivers/input/keyboard/tegra-kbc.c')
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 8508879f6faf..9757a58bc897 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/clk.h> | 31 | #include <linux/clk.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/input/matrix_keypad.h> | 33 | #include <linux/input/matrix_keypad.h> |
34 | #include <linux/clk/tegra.h> | 34 | #include <linux/reset.h> |
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | 36 | ||
37 | #define KBC_MAX_KPENT 8 | 37 | #define KBC_MAX_KPENT 8 |
@@ -116,6 +116,7 @@ struct tegra_kbc { | |||
116 | u32 wakeup_key; | 116 | u32 wakeup_key; |
117 | struct timer_list timer; | 117 | struct timer_list timer; |
118 | struct clk *clk; | 118 | struct clk *clk; |
119 | struct reset_control *rst; | ||
119 | const struct tegra_kbc_hw_support *hw_support; | 120 | const struct tegra_kbc_hw_support *hw_support; |
120 | int max_keys; | 121 | int max_keys; |
121 | int num_rows_and_columns; | 122 | int num_rows_and_columns; |
@@ -373,9 +374,9 @@ static int tegra_kbc_start(struct tegra_kbc *kbc) | |||
373 | clk_prepare_enable(kbc->clk); | 374 | clk_prepare_enable(kbc->clk); |
374 | 375 | ||
375 | /* Reset the KBC controller to clear all previous status.*/ | 376 | /* Reset the KBC controller to clear all previous status.*/ |
376 | tegra_periph_reset_assert(kbc->clk); | 377 | reset_control_assert(kbc->rst); |
377 | udelay(100); | 378 | udelay(100); |
378 | tegra_periph_reset_deassert(kbc->clk); | 379 | reset_control_assert(kbc->rst); |
379 | udelay(100); | 380 | udelay(100); |
380 | 381 | ||
381 | tegra_kbc_config_pins(kbc); | 382 | tegra_kbc_config_pins(kbc); |
@@ -663,6 +664,12 @@ static int tegra_kbc_probe(struct platform_device *pdev) | |||
663 | return PTR_ERR(kbc->clk); | 664 | return PTR_ERR(kbc->clk); |
664 | } | 665 | } |
665 | 666 | ||
667 | kbc->rst = devm_reset_control_get(&pdev->dev, "kbc"); | ||
668 | if (IS_ERR(kbc->rst)) { | ||
669 | dev_err(&pdev->dev, "failed to get keyboard reset\n"); | ||
670 | return PTR_ERR(kbc->rst); | ||
671 | } | ||
672 | |||
666 | /* | 673 | /* |
667 | * The time delay between two consecutive reads of the FIFO is | 674 | * The time delay between two consecutive reads of the FIFO is |
668 | * the sum of the repeat time and the time taken for scanning | 675 | * the sum of the repeat time and the time taken for scanning |