aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/nomadik-ske-keypad.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 95dcc9bdeec3..a1a9375f18ff 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -67,6 +67,7 @@ struct ske_keypad {
67 const struct ske_keypad_platform_data *board; 67 const struct ske_keypad_platform_data *board;
68 unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS]; 68 unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS];
69 struct clk *clk; 69 struct clk *clk;
70 struct clk *pclk;
70 spinlock_t ske_keypad_lock; 71 spinlock_t ske_keypad_lock;
71}; 72};
72 73
@@ -271,11 +272,18 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
271 goto err_free_mem_region; 272 goto err_free_mem_region;
272 } 273 }
273 274
275 keypad->pclk = clk_get(&pdev->dev, "apb_pclk");
276 if (IS_ERR(keypad->pclk)) {
277 dev_err(&pdev->dev, "failed to get pclk\n");
278 error = PTR_ERR(keypad->pclk);
279 goto err_iounmap;
280 }
281
274 keypad->clk = clk_get(&pdev->dev, NULL); 282 keypad->clk = clk_get(&pdev->dev, NULL);
275 if (IS_ERR(keypad->clk)) { 283 if (IS_ERR(keypad->clk)) {
276 dev_err(&pdev->dev, "failed to get clk\n"); 284 dev_err(&pdev->dev, "failed to get clk\n");
277 error = PTR_ERR(keypad->clk); 285 error = PTR_ERR(keypad->clk);
278 goto err_iounmap; 286 goto err_pclk;
279 } 287 }
280 288
281 input->id.bustype = BUS_HOST; 289 input->id.bustype = BUS_HOST;
@@ -294,10 +302,16 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
294 if (!plat->no_autorepeat) 302 if (!plat->no_autorepeat)
295 __set_bit(EV_REP, input->evbit); 303 __set_bit(EV_REP, input->evbit);
296 304
305 error = clk_prepare_enable(keypad->pclk);
306 if (error) {
307 dev_err(&pdev->dev, "Failed to prepare/enable pclk\n");
308 goto err_clk;
309 }
310
297 error = clk_prepare_enable(keypad->clk); 311 error = clk_prepare_enable(keypad->clk);
298 if (error) { 312 if (error) {
299 dev_err(&pdev->dev, "Failed to prepare/enable clk\n"); 313 dev_err(&pdev->dev, "Failed to prepare/enable clk\n");
300 goto err_clk; 314 goto err_pclk_disable;
301 } 315 }
302 316
303 317
@@ -336,8 +350,12 @@ err_free_irq:
336 free_irq(keypad->irq, keypad); 350 free_irq(keypad->irq, keypad);
337err_clk_disable: 351err_clk_disable:
338 clk_disable_unprepare(keypad->clk); 352 clk_disable_unprepare(keypad->clk);
353err_pclk_disable:
354 clk_disable_unprepare(keypad->pclk);
339err_clk: 355err_clk:
340 clk_put(keypad->clk); 356 clk_put(keypad->clk);
357err_pclk:
358 clk_put(keypad->pclk);
341err_iounmap: 359err_iounmap:
342 iounmap(keypad->reg_base); 360 iounmap(keypad->reg_base);
343err_free_mem_region: 361err_free_mem_region: