From patchwork Tue Feb 4 15:58:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3577421 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AF1679F2F5 for ; Tue, 4 Feb 2014 16:03:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2E8720179 for ; Tue, 4 Feb 2014 16:03:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 041BD200FF for ; Tue, 4 Feb 2014 16:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932152AbaBDP7o (ORCPT ); Tue, 4 Feb 2014 10:59:44 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:42558 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754674AbaBDP7k (ORCPT ); Tue, 4 Feb 2014 10:59:40 -0500 Received: by mail-la0-f47.google.com with SMTP id hr17so6650411lab.34 for ; Tue, 04 Feb 2014 07:59:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gtnKZKUGVpEy/SbL+NoxlLI07CIR+6JLC5jZDMv/S/o=; b=lqq7kJShlXgDkQJgcBCbF4M+gOlsbeZeerZYcDIMtxgtefvG0Mr1Y5qfPYwaL01fzw ZW7oUftaS+UOJbU9n1k7oZ2o2q6LqwueSlSOcXdk8c5YrTr2WJmp1+IhvWbaBD83kX+c R5UPEZr/biiKLPpfNM2MSNsY9t0lVdjjz7jw8umQbPKZx4Uey88heK3ymAjnygvQb0cB lsVshqo+9bjCMqMHSIW1y9SHZZDTcnte7DwRfWWW1MEUGBBzez9c7a17YJC+UmUWsHCk eVk/PLPMKs0+fxFlV1XG3bnt3hUP0ioqHHykZMLSjA6DCU5gz+BDEXFWJAhfo+P1tAkU NDug== X-Gm-Message-State: ALoCoQnqizB6ZtzPqxQ+LSejHiqDHlZ4OnZOW6cCq22RC+DTYPHEng9Bl0DL/pm4DhPVICBTjr+5 X-Received: by 10.152.2.169 with SMTP id 9mr531996lav.48.1391529579498; Tue, 04 Feb 2014 07:59:39 -0800 (PST) Received: from localhost.localdomain (host-95-199-220-119.mobileonline.telia.com. [95.199.220.119]) by mx.google.com with ESMTPSA id dm8sm35906603lad.7.2014.02.04.07.59.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:38 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Alessandro Rubini , Linus Walleij , Wolfram Sang , Chris Ball , Mark Brown , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 08/17] spi: pl022: Fully gate clocks at request inactivity Date: Tue, 4 Feb 2014 16:58:49 +0100 Message-Id: <1391529538-21685-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> References: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Use clk_disable_unprepare and clk_prepare_enable from the runtime PM callbacks, to fully gate|ungate clocks. Potentially this will save more power, depending on the clock tree for the current SOC. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi-pl022.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index db829a1..2bb238f 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2355,7 +2355,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); pinctrl_pm_select_idle_state(dev); return 0; @@ -2366,7 +2366,7 @@ static int pl022_runtime_resume(struct device *dev) struct pl022 *pl022 = dev_get_drvdata(dev); pinctrl_pm_select_default_state(dev); - clk_enable(pl022->clk); + clk_prepare_enable(pl022->clk); return 0; }