Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318286
b: refs/heads/master
c: 333fbe8
h: refs/heads/master
v: v3
  • Loading branch information
Fabio Estevam authored and Dmitry Torokhov committed Jul 7, 2012
1 parent c5169ce commit d4123a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a40ec72d540553fc0e1d1fea94c1d7629b7f35f4
refs/heads/master: 333fbe8409dfabd3d3581af5cdbd30f666857437
19 changes: 14 additions & 5 deletions trunk/drivers/input/keyboard/imx_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,18 @@ static void imx_keypad_close(struct input_dev *dev)
static int imx_keypad_open(struct input_dev *dev)
{
struct imx_keypad *keypad = input_get_drvdata(dev);
int error;

dev_dbg(&dev->dev, ">%s\n", __func__);

/* Enable the kpp clock */
error = clk_prepare_enable(keypad->clk);
if (error)
return error;

/* We became active from now */
keypad->enabled = true;

/* Enable the kpp clock */
clk_prepare_enable(keypad->clk);
imx_keypad_config(keypad);

/* Sanity control, not all the rows must be actived now. */
Expand Down Expand Up @@ -596,18 +600,23 @@ static int imx_kbd_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct imx_keypad *kbd = platform_get_drvdata(pdev);
struct input_dev *input_dev = kbd->input_dev;
int ret = 0;

if (device_may_wakeup(&pdev->dev))
disable_irq_wake(kbd->irq);

mutex_lock(&input_dev->mutex);

if (input_dev->users)
clk_prepare_enable(kbd->clk);
if (input_dev->users) {
ret = clk_prepare_enable(kbd->clk);
if (ret)
goto err_clk;
}

err_clk:
mutex_unlock(&input_dev->mutex);

return 0;
return ret;
}
#endif

Expand Down

0 comments on commit d4123a6

Please sign in to comment.