From patchwork Mon Sep 17 10:37:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vipul kumar samar X-Patchwork-Id: 1466471 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id A58AFDF2D8 for ; Mon, 17 Sep 2012 10:37:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.b.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TDYhr-0005Wb-22; Mon, 17 Sep 2012 10:37:35 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TDYhq-0005WW-11 for spi-devel-general@lists.sourceforge.net; Mon, 17 Sep 2012 10:37:34 +0000 X-ACL-Warn: Received: from eu1sys200aog111.obsmtp.com ([207.126.144.131]) by sog-mx-3.v43.ch3.sourceforge.com with smtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1TDYho-0001kY-RH for spi-devel-general@lists.sourceforge.net; Mon, 17 Sep 2012 10:37:33 +0000 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUFb9XbK5GtpZQqnGh2xg1+eAsbtg/gRP@postini.com; Mon, 17 Sep 2012 10:37:32 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 6320ACF; Mon, 17 Sep 2012 10:28:59 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas4.st.com [10.80.176.69]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5C1F5C1E; Mon, 17 Sep 2012 10:37:13 +0000 (GMT) Received: from localhost (10.199.88.141) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 17 Sep 2012 18:37:13 +0800 From: Vipul Kumar Samar To: , Subject: [PATCH] spi: pl022: Add clk_{un}prepare() support in runtime PM Date: Mon, 17 Sep 2012 16:07:10 +0530 Message-ID: <1f784b72399e0e96414f00866b209e2e218065af.1347877746.git.vipulkumar.samar@st.com> X-Mailer: git-send-email 1.7.2.2 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1TDYho-0001kY-RH Cc: Vipul Kumar Samar , linus.walleij@linaro.org, spear-devel@list.st.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net clk_{un}prepare is mandatory for platforms using common clock framework. Add clk_{un}prepare() support for spi-pl022 runtime PM. Signed-off-by: Vipul Kumar Samar --- drivers/spi/spi-pl022.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index f2a80ff..500e75e 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2334,7 +2334,7 @@ static int pl022_runtime_suspend(struct device *dev) { struct pl022 *pl022 = dev_get_drvdata(dev); - clk_disable(pl022->clk); + clk_disable_unprepare(pl022->clk); return 0; } @@ -2342,10 +2342,13 @@ static int pl022_runtime_suspend(struct device *dev) static int pl022_runtime_resume(struct device *dev) { struct pl022 *pl022 = dev_get_drvdata(dev); + int ret = 0; - clk_enable(pl022->clk); + ret = clk_prepare_enable(pl022->clk); + if (ret) + dev_err(dev, "could not enable SSP/SPI bus clock\n"); - return 0; + return ret; } #endif