From patchwork Mon Mar 21 11:10:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 647741 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2LBAbJ4013548 for ; Mon, 21 Mar 2011 11:10:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942Ab1CULKh (ORCPT ); Mon, 21 Mar 2011 07:10:37 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:51851 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833Ab1CULKd (ORCPT ); Mon, 21 Mar 2011 07:10:33 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2LBASAb018466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Mar 2011 06:10:30 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p2LBAPNQ012848; Mon, 21 Mar 2011 16:40:25 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id p2LBAPs4012825; Mon, 21 Mar 2011 16:40:25 +0530 Received: (from a0131687@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id p2LBAOrF012823; Mon, 21 Mar 2011 16:40:24 +0530 From: Rajendra Nayak To: linux-omap@vger.kernel.org Cc: paul@pwsan.com, b-cousson@ti.com, Rajendra Nayak Subject: [RFC 2/3] OMAP3: hwmod: Add support to associate an initiator with a hwmod Date: Mon, 21 Mar 2011 16:40:22 +0530 Message-Id: <1300705823-12784-3-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.5.6.6 In-Reply-To: <1300705823-12784-2-git-send-email-rnayak@ti.com> References: <1300705823-12784-1-git-send-email-rnayak@ti.com> <1300705823-12784-2-git-send-email-rnayak@ti.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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Mar 2011 11:10:40 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e034294..d4826be 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2369,3 +2369,36 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh) return 0; } + +int omap_hwmod_add_initiator_user(struct omap_hwmod *oh, u8 init_id) +{ + if (oh->_state != _HWMOD_STATE_ENABLED) + return -EINVAL; + + if (cpu_is_omap34xx()) { + return omap2_prm_module_enable_initiator_wakeup( + oh->prcm.omap2.module_offs, + oh->prcm.omap2.idlest_reg_id, + oh->prcm.omap2.idlest_idle_bit, + init_id); + } + + return -EINVAL; +} + +int omap_hwmod_del_initiator_user(struct omap_hwmod *oh, u8 init_id) +{ + if (oh->_state == _HWMOD_STATE_ENABLED) + return -EINVAL; + + if (cpu_is_omap34xx()) { + return omap2_prm_module_disable_initiator_wakeup( + oh->prcm.omap2.module_offs, + oh->prcm.omap2.idlest_reg_id, + oh->prcm.omap2.idlest_idle_bit, + init_id); + } + + return -EINVAL; + +} diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 4bd7354..fe47448 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -590,6 +590,8 @@ int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh); int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh); +int omap_hwmod_add_initiator_user(struct omap_hwmod *oh, u8 init_id); +int omap_hwmod_del_initiator_user(struct omap_hwmod *oh, u8 init_id); int omap_hwmod_set_clockact_both(struct omap_hwmod *oh); int omap_hwmod_set_clockact_main(struct omap_hwmod *oh);