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: 2682531 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AD5DB3FD4E for ; Thu, 6 Jun 2013 18:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751305Ab3FFSOd (ORCPT ); Thu, 6 Jun 2013 14:14:33 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:40847 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146Ab3FFSOb (ORCPT ); Thu, 6 Jun 2013 14:14:31 -0400 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: CC: , , , , , Mugunthan V N 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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;