From patchwork Thu Nov 19 15:18:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Huerst X-Patchwork-Id: 7658301 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 438929F392 for ; Thu, 19 Nov 2015 15:18:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64F6320662 for ; Thu, 19 Nov 2015 15:18:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B4512066B for ; Thu, 19 Nov 2015 15:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757853AbbKSPSv (ORCPT ); Thu, 19 Nov 2015 10:18:51 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36359 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757113AbbKSPSu (ORCPT ); Thu, 19 Nov 2015 10:18:50 -0500 Received: by wmww144 with SMTP id w144so242829935wmw.1 for ; Thu, 19 Nov 2015 07:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=NdwiTj+7lWYkUSL06RQX+P+eg6qmR9kZ7XjlP31TO+I=; b=pMXi+am66IRVOaChCrelaxYXFD+AiglME6z1g2z9kFnVXjsQIVY8QqRd5M50BU8Gap UE+wNKZwtgof/vB0NQEHgTEL1Rd3QFbrkvdLQDxXSncuLZiHkzOq9BHVCLn4UjYvSLiA D7eo94dbQycgtEI2IOtQfqIzLTHvJPevE22R7jMJDoVLRTR81MrIsiMiOhNhmBdoSOH7 0ZmzmIv+c9ZNCa3clOEmtEp98dfOVtlFZWXMTJMvRMTExzfUq743unYE9uzg5zpecvgC EJx3yiPxXlEmdFLCU8Brw81BsVq9CvgSo6mSLQSwD5nstRZXqx6Vllf0Yn5S+HVLUWOR tlag== X-Received: by 10.28.183.215 with SMTP id h206mr17779739wmf.0.1447946329465; Thu, 19 Nov 2015 07:18:49 -0800 (PST) Received: from linux.fritz.box ([212.91.253.218]) by smtp.gmail.com with ESMTPSA id t64sm2544195wmf.23.2015.11.19.07.18.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2015 07:18:48 -0800 (PST) From: pascal.huerst@gmail.com To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, Pascal Huerst Subject: [PATCH v2] spi: omap2-mcspi: Add calls for pinctrl state select Date: Thu, 19 Nov 2015 16:18:28 +0100 Message-Id: <1447946308-2003-1-git-send-email-pascal.huerst@gmail.com> X-Mailer: git-send-email 2.4.3 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Pascal Huerst This adds calls to pinctrl subsystem in order to switch pin states on suspend/resume if you provide a "sleep" state in DT. If no "sleep" state is provided in DT, these calls turn to NOPs. Signed-off-by: Pascal Huerst --- drivers/spi/spi-omap2-mcspi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 3d09e0b..2c099c5 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1508,14 +1509,23 @@ static int omap2_mcspi_resume(struct device *dev) } pm_runtime_mark_last_busy(mcspi->dev); pm_runtime_put_autosuspend(mcspi->dev); - return 0; + + return pinctrl_pm_select_default_state(dev); +} + +static int omap2_mcspi_suspend(struct device *dev) +{ + return pinctrl_pm_select_sleep_state(dev); } + #else +#define omap2_mcspi_suspend NULL #define omap2_mcspi_resume NULL #endif static const struct dev_pm_ops omap2_mcspi_pm_ops = { .resume = omap2_mcspi_resume, + .suspend = omap2_mcspi_suspend, .runtime_resume = omap_mcspi_runtime_resume, };