diff options
| -rw-r--r-- | drivers/input/keyboard/imx_keypad.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 4830615ed2ec..ff4c0a87a25f 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c | |||
| @@ -384,14 +384,18 @@ static void imx_keypad_close(struct input_dev *dev) | |||
| 384 | static int imx_keypad_open(struct input_dev *dev) | 384 | static int imx_keypad_open(struct input_dev *dev) |
| 385 | { | 385 | { |
| 386 | struct imx_keypad *keypad = input_get_drvdata(dev); | 386 | struct imx_keypad *keypad = input_get_drvdata(dev); |
| 387 | int error; | ||
| 387 | 388 | ||
| 388 | dev_dbg(&dev->dev, ">%s\n", __func__); | 389 | dev_dbg(&dev->dev, ">%s\n", __func__); |
| 389 | 390 | ||
| 391 | /* Enable the kpp clock */ | ||
| 392 | error = clk_prepare_enable(keypad->clk); | ||
| 393 | if (error) | ||
| 394 | return error; | ||
| 395 | |||
| 390 | /* We became active from now */ | 396 | /* We became active from now */ |
| 391 | keypad->enabled = true; | 397 | keypad->enabled = true; |
| 392 | 398 | ||
| 393 | /* Enable the kpp clock */ | ||
| 394 | clk_prepare_enable(keypad->clk); | ||
| 395 | imx_keypad_config(keypad); | 399 | imx_keypad_config(keypad); |
| 396 | 400 | ||
| 397 | /* Sanity control, not all the rows must be actived now. */ | 401 | /* Sanity control, not all the rows must be actived now. */ |
| @@ -596,18 +600,23 @@ static int imx_kbd_resume(struct device *dev) | |||
| 596 | struct platform_device *pdev = to_platform_device(dev); | 600 | struct platform_device *pdev = to_platform_device(dev); |
| 597 | struct imx_keypad *kbd = platform_get_drvdata(pdev); | 601 | struct imx_keypad *kbd = platform_get_drvdata(pdev); |
| 598 | struct input_dev *input_dev = kbd->input_dev; | 602 | struct input_dev *input_dev = kbd->input_dev; |
| 603 | int ret = 0; | ||
| 599 | 604 | ||
| 600 | if (device_may_wakeup(&pdev->dev)) | 605 | if (device_may_wakeup(&pdev->dev)) |
| 601 | disable_irq_wake(kbd->irq); | 606 | disable_irq_wake(kbd->irq); |
| 602 | 607 | ||
| 603 | mutex_lock(&input_dev->mutex); | 608 | mutex_lock(&input_dev->mutex); |
| 604 | 609 | ||
| 605 | if (input_dev->users) | 610 | if (input_dev->users) { |
| 606 | clk_prepare_enable(kbd->clk); | 611 | ret = clk_prepare_enable(kbd->clk); |
| 612 | if (ret) | ||
| 613 | goto err_clk; | ||
| 614 | } | ||
| 607 | 615 | ||
| 616 | err_clk: | ||
| 608 | mutex_unlock(&input_dev->mutex); | 617 | mutex_unlock(&input_dev->mutex); |
| 609 | 618 | ||
| 610 | return 0; | 619 | return ret; |
| 611 | } | 620 | } |
| 612 | #endif | 621 | #endif |
| 613 | 622 | ||
