From patchwork Thu Jun 6 18:15:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 2682541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 85D3C3FD4E for ; Thu, 6 Jun 2013 18:14:38 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukeho-0008Cn-QL; Thu, 06 Jun 2013 18:14:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukehl-0007nM-QE; Thu, 06 Jun 2013 18:14:33 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukehj-0007me-2E for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2013 18:14:31 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r56IE6Q3032504; Thu, 6 Jun 2013 13:14:06 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r56IE6Yx026561; Thu, 6 Jun 2013 13:14:06 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Thu, 6 Jun 2013 13:14:06 -0500 Received: from a0131834-linux.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r56IE0fq027287; Thu, 6 Jun 2013 13:14:04 -0500 From: Mugunthan V N To: Subject: [PATCH 1/2] drivers: net: cpsw: use pinctrl PM helpers Date: Thu, 6 Jun 2013 23:45:14 +0530 Message-ID: <1370542515-22009-2-git-send-email-mugunthanvnm@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370542515-22009-1-git-send-email-mugunthanvnm@ti.com> References: <1370542515-22009-1-git-send-email-mugunthanvnm@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130606_141431_174757_BBF5B5B0 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mugunthan V N , linus.walleij@linaro.org, broonie@kernel.org, linux-omap@vger.kernel.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This utilize the new pinctrl core PM helpers to transition the driver to "default" and "sleep" states. Signed-off-by: Mugunthan V N --- drivers/net/ethernet/ti/cpsw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index a45f64e..5143552 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -35,6 +35,7 @@ #include #include +#include #include "cpsw_ale.h" #include "cpts.h" @@ -1691,6 +1692,9 @@ static int cpsw_probe(struct platform_device *pdev) */ pm_runtime_enable(&pdev->dev); + /* Select default pin state */ + pinctrl_pm_select_default_state(&pdev->dev); + if (cpsw_probe_dt(&priv->data, pdev)) { pr_err("cpsw: platform data missing\n"); ret = -ENODEV; @@ -1979,6 +1983,9 @@ static int cpsw_suspend(struct device *dev) cpsw_ndo_stop(ndev); pm_runtime_put_sync(&pdev->dev); + /* Select sleep pin state */ + pinctrl_pm_select_sleep_state(&pdev->dev); + return 0; } @@ -1988,6 +1995,10 @@ static int cpsw_resume(struct device *dev) struct net_device *ndev = platform_get_drvdata(pdev); pm_runtime_get_sync(&pdev->dev); + + /* Select default pin state */ + pinctrl_pm_select_default_state(&pdev->dev); + if (netif_running(ndev)) cpsw_ndo_open(ndev); return 0;