From patchwork Thu Nov 6 19:07:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 5246551 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A6349F387 for ; Thu, 6 Nov 2014 19:07:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D27792011D for ; Thu, 6 Nov 2014 19:07:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBCD42010F for ; Thu, 6 Nov 2014 19:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751306AbaKFTHs (ORCPT ); Thu, 6 Nov 2014 14:07:48 -0500 Received: from www.linutronix.de ([62.245.132.108]:44561 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbaKFTHs (ORCPT ); Thu, 6 Nov 2014 14:07:48 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1XmSPJ-0004D6-Je; Thu, 06 Nov 2014 20:07:45 +0100 From: Sebastian Andrzej Siewior To: linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , linux-omap@vger.kernel.org, Sebastian Andrzej Siewior , Dave Gerlach , Nishanth Menon Subject: [PATCH] tty: serial: 8250: omap: Add pinctrl support for suspend Date: Thu, 6 Nov 2014 20:07:30 +0100 Message-Id: <1415300850-21452-1-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 2.1.1 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001, URIBL_BLOCKED=0.001 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is mostly an equivalent for the 8250-omap driver based on a patch of Dave Gerlach for the omap-serial driver (which is not yet merged). From his changelog: |By optionally putting the pins into sleep state in the suspend callback |we can accomplish two things. |- minimize current leakage from pins and thus save power, |- prevent the IP from driving pins output in an uncontrolled manner, | which may happen if the power domain drops the domain regulator. The pinctlr change is put before enable_wakeup logic as per Nishanth Menon (slightly reworded): |When wakeup is enabled, I/O daisy chain based wakeup is used by |reconfiguring the padconfig register. However, this gets overriden by |sleep/wakeup configuration. Therefore we need first to allow pinctrl to |play with the wakeup bits as needed beyond the sleep configuration. Cc: Dave Gerlach Cc: Nishanth Menon Signed-off-by: Sebastian Andrzej Siewior --- drivers/tty/serial/8250/8250_omap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 57a8b1241b85..1681875f2996 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -1156,6 +1156,7 @@ static int omap8250_suspend(struct device *dev) serial8250_suspend_port(priv->line); flush_work(&priv->qos_work); + pinctrl_pm_select_sleep_state(dev); if (device_may_wakeup(dev)) omap8250_enable_wakeup(priv, true); else @@ -1167,6 +1168,7 @@ static int omap8250_resume(struct device *dev) { struct omap8250_priv *priv = dev_get_drvdata(dev); + pinctrl_pm_select_default_state(dev); if (device_may_wakeup(dev)) omap8250_enable_wakeup(priv, false);