From patchwork Wed Feb 19 18:25:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 3682621 Return-Path: X-Original-To: patchwork-linux-omap@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 388449F2EC for ; Wed, 19 Feb 2014 18:25:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B1DF201F7 for ; Wed, 19 Feb 2014 18:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1789A201F0 for ; Wed, 19 Feb 2014 18:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754615AbaBSSZI (ORCPT ); Wed, 19 Feb 2014 13:25:08 -0500 Received: from utopia.booyaka.com ([74.50.51.50]:42397 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754583AbaBSSZH (ORCPT ); Wed, 19 Feb 2014 13:25:07 -0500 Received: (qmail 17330 invoked by uid 1019); 19 Feb 2014 18:25:06 -0000 Date: Wed, 19 Feb 2014 18:25:06 +0000 (UTC) From: Paul Walmsley To: linux-arm-kernel@lists.infradead.org cc: linux-omap@vger.kernel.org, d-gerlach@ti.com Subject: [RFC PATCH] ARM: OMAP2+: clockdomain: Reintroduce SW_SLEEP Support (fwd) Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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=ham 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 Just FYI. Queued for v3.15 unless someone complains. - Paul ---------- Forwarded message ---------- Date: Fri, 7 Feb 2014 16:20:59 -0600 From: Dave Gerlach To: linux-omap@vger.kernel.org Cc: Tony Lindgren , Paul Walmsley , Rajendra Nayak , Nishanth Menon , Dave Gerlach Subject: [RFC PATCH] ARM: OMAP2+: clockdomain: Reintroduce SW_SLEEP Support Since commit 65aa94b204d (ARM: OMAP4: clockdomain/CM code: Update supported transition modes), on OMAP4, all CLKDMs support HW_AUTO so this is used instead of SW_SLEEP for the idling of clockdomains. However, additional SoCs now leverage the OMAP4 clockdomain code so update it to use SW_SLEEP if the clockdomain data specifies that the CLKDM has the CLKDM_CAN_FORCE_SLEEP flag set rather than using HW_AUTO for both cases. Signed-off-by: Dave Gerlach --- arch/arm/mach-omap2/cminst44xx.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 731ca13..f5c4731 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c @@ -254,6 +254,11 @@ void omap4_cminst_clkdm_force_wakeup(u8 part, u16 inst, u16 cdoffs) * */ +void omap4_cminst_clkdm_force_sleep(u8 part, u16 inst, u16 cdoffs) +{ + _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs); +} + /** * omap4_cminst_wait_module_ready - wait for a module to be in 'func' state * @part: PRCM partition ID that the CM_CLKCTRL register exists in @@ -404,8 +409,17 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) static int omap4_clkdm_sleep(struct clockdomain *clkdm) { - omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, - clkdm->cm_inst, clkdm->clkdm_offs); + if (clkdm->flags & CLKDM_CAN_HWSUP) + omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, + clkdm->cm_inst, + clkdm->clkdm_offs); + else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP) + omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, + clkdm->cm_inst, + clkdm->clkdm_offs); + else + return -EINVAL; + return 0; }