]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00283508-3 keyboard: imx: support pin sleep mode in suspend
authorAnson Huang <b20788@freescale.com>
Mon, 14 Oct 2013 19:19:20 +0000 (15:19 -0400)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:01:34 +0000 (18:01 +0200)
When system suspend, need to switch keyboard pins to sleep mode,
this is to save IO power. Using pinctrl mode switch framework
to make it happen.

Signed-off-by: Anson Huang <b20788@freescale.com>
drivers/input/keyboard/imx_keypad.c

index 8280cb16260be6f31840480ca3fd19a64bfffa1c..3d4cf952075e44249ad640b84f3af2ec43e9aae3 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Driver for the IMX keypad port.
  * Copyright (C) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -548,6 +549,8 @@ static int imx_kbd_suspend(struct device *dev)
 
        if (device_may_wakeup(&pdev->dev))
                enable_irq_wake(kbd->irq);
+       else
+               pinctrl_pm_select_sleep_state(dev);
 
        return 0;
 }
@@ -561,6 +564,8 @@ static int imx_kbd_resume(struct device *dev)
 
        if (device_may_wakeup(&pdev->dev))
                disable_irq_wake(kbd->irq);
+       else
+               pinctrl_pm_select_default_state(dev);
 
        mutex_lock(&input_dev->mutex);