From: Anson Huang Date: Mon, 14 Oct 2013 19:19:20 +0000 (-0400) Subject: ENGR00283508-3 keyboard: imx: support pin sleep mode in suspend X-Git-Tag: KARO-TX6-2014-07-10~193 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7d4135f5d3a374b5db6886db7015919fa43f4076;p=karo-tx-linux.git ENGR00283508-3 keyboard: imx: support pin sleep mode in suspend 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 --- diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 8280cb16260b..3d4cf952075e 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -1,6 +1,7 @@ /* * Driver for the IMX keypad port. * Copyright (C) 2009 Alberto Panizzo + * 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);