From 7d4135f5d3a374b5db6886db7015919fa43f4076 Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Mon, 14 Oct 2013 15:19:20 -0400 Subject: [PATCH] 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 --- drivers/input/keyboard/imx_keypad.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.5