From patchwork Thu May 27 21:13:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 102782 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4RLDh6b006956 for ; Thu, 27 May 2010 21:13:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756278Ab0E0VNm (ORCPT ); Thu, 27 May 2010 17:13:42 -0400 Received: from mail-pz0-f176.google.com ([209.85.222.176]:64008 "EHLO mail-pz0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754206Ab0E0VNl (ORCPT ); Thu, 27 May 2010 17:13:41 -0400 Received: by mail-pz0-f176.google.com with SMTP id 6so314656pzk.1 for ; Thu, 27 May 2010 14:13:41 -0700 (PDT) Received: by 10.142.59.10 with SMTP id h10mr235283wfa.284.1274994821254; Thu, 27 May 2010 14:13:41 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id 20sm1258817pzk.7.2010.05.27.14.13.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 May 2010 14:13:39 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH 1/5] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE Date: Thu, 27 May 2010 14:13:32 -0700 Message-Id: <1274994816-30335-2-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.7.0.2 In-Reply-To: <1274994816-30335-1-git-send-email-khilman@deeprootsystems.com> References: <1274994816-30335-1-git-send-email-khilman@deeprootsystems.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 27 May 2010 21:13:43 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 2fff39f..a127c9b 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -939,7 +939,13 @@ static int _enable(struct omap_hwmod *oh) */ static int _idle(struct omap_hwmod *oh) { - if (oh->_state != _HWMOD_STATE_ENABLED) { + /* + * To idle, hwmod must be enabled, EXCEPT if hwmod was + * initialized using the INIT_NO_IDLE flag. In this case it + * will not yet be enabled so we have to allow it to be idled. + */ + if ((oh->_state != _HWMOD_STATE_ENABLED) && + !(oh->flags & HWMOD_INIT_NO_IDLE)) { WARN(1, "omap_hwmod: %s: idle state can only be entered from " "enabled state\n", oh->name); return -EINVAL; @@ -954,6 +960,9 @@ static int _idle(struct omap_hwmod *oh) oh->_state = _HWMOD_STATE_IDLE; + /* Clear init flag which should only affect first call to idle */ + oh->flags &= ~HWMOD_INIT_NO_IDLE; + return 0; }