From patchwork Wed Jun 23 23:42:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 107712 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5NNeCTQ009320 for ; Wed, 23 Jun 2010 23:43:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754105Ab0FWXm5 (ORCPT ); Wed, 23 Jun 2010 19:42:57 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:54392 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983Ab0FWXm4 (ORCPT ); Wed, 23 Jun 2010 19:42:56 -0400 Received: by pvg2 with SMTP id 2so111388pvg.19 for ; Wed, 23 Jun 2010 16:42:56 -0700 (PDT) Received: by 10.114.164.39 with SMTP id m39mr8406501wae.56.1277336576019; Wed, 23 Jun 2010 16:42:56 -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 h9sm48268186wal.12.2010.06.23.16.42.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Jun 2010 16:42:55 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: paul@pwsan.com Subject: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functions Date: Wed, 23 Jun 2010 16:42:36 -0700 Message-Id: <1277336563-24988-7-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.7.0.2 In-Reply-To: <1277336563-24988-1-git-send-email-khilman@deeprootsystems.com> References: <1277336563-24988-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]); Wed, 23 Jun 2010 23:43:45 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 3d11523..8b2b44a 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1287,6 +1287,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) } /** + * __omap_hwmod_enable - enable an omap_hwmod (non-locking version) + * @oh: struct omap_hwmod * + * + * Enable an omap_hwomd @oh. Intended to be called in rare cases + * where usage is required in atomic context. + */ +int __omap_hwmod_enable(struct omap_hwmod *oh) +{ + return _enable(oh); +} + +/** * omap_hwmod_enable - enable an omap_hwmod * @oh: struct omap_hwmod * * @@ -1301,12 +1313,26 @@ int omap_hwmod_enable(struct omap_hwmod *oh) return -EINVAL; mutex_lock(&omap_hwmod_mutex); - r = _enable(oh); + r = __omap_hwmod_enable(oh); mutex_unlock(&omap_hwmod_mutex); return r; } + +/** + * __omap_hwmod_idle - idle an omap_hwmod (non-locking) + * @oh: struct omap_hwmod * + * + * Idle an omap_hwomd @oh. Intended to be called in rare instances where + * used in atomic context. + */ +int __omap_hwmod_idle(struct omap_hwmod *oh) +{ + _idle(oh); + return 0; +} + /** * omap_hwmod_idle - idle an omap_hwmod * @oh: struct omap_hwmod * @@ -1319,9 +1345,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh) if (!oh) return -EINVAL; - mutex_lock(&omap_hwmod_mutex); - _idle(oh); - mutex_unlock(&omap_hwmod_mutex); + __omap_hwmod_idle(oh); return 0; } diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 0eccc09..9a3f4dc 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -486,7 +486,9 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh)); int omap_hwmod_late_init(void); int omap_hwmod_enable(struct omap_hwmod *oh); +int __omap_hwmod_enable(struct omap_hwmod *oh); int omap_hwmod_idle(struct omap_hwmod *oh); +int __omap_hwmod_idle(struct omap_hwmod *oh); int omap_hwmod_shutdown(struct omap_hwmod *oh); int omap_hwmod_enable_clocks(struct omap_hwmod *oh);