From patchwork Thu Jun 6 18:15:15 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: 2682551 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 3BBD93FD4E for ; Thu, 6 Jun 2013 18:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751353Ab3FFSOk (ORCPT ); Thu, 6 Jun 2013 14:14:40 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:37001 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146Ab3FFSOg (ORCPT ); Thu, 6 Jun 2013 14:14:36 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r56IE9O3019010; Thu, 6 Jun 2013 13:14:09 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r56IE9hq026621; Thu, 6 Jun 2013 13:14:09 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Thu, 6 Jun 2013 13:14:08 -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 r56IE0fr027287; Thu, 6 Jun 2013 13:14:06 -0500 From: Mugunthan V N To: CC: , , , , , Mugunthan V N Subject: [PATCH 2/2] drivers: net: davinci_mdio: use pinctrl PM helpers Date: Thu, 6 Jun 2013 23:45:15 +0530 Message-ID: <1370542515-22009-3-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/davinci_mdio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 12aec17..5e361f4 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -38,6 +38,7 @@ #include #include #include +#include /* * This timeout definition is a worst-case ultra defensive measure against @@ -347,6 +348,9 @@ static int davinci_mdio_probe(struct platform_device *pdev) data->bus->parent = dev; data->bus->priv = data; + /* Select default pin state */ + pinctrl_pm_select_default_state(&pdev->dev); + pm_runtime_enable(&pdev->dev); pm_runtime_get_sync(&pdev->dev); data->clk = clk_get(&pdev->dev, "fck"); @@ -454,6 +458,9 @@ static int davinci_mdio_suspend(struct device *dev) data->suspended = true; spin_unlock(&data->lock); + /* Select sleep pin state */ + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -462,6 +469,9 @@ static int davinci_mdio_resume(struct device *dev) struct davinci_mdio_data *data = dev_get_drvdata(dev); u32 ctrl; + /* Select default pin state */ + pinctrl_pm_select_default_state(dev); + spin_lock(&data->lock); pm_runtime_get_sync(data->dev);