From patchwork Thu Aug 26 11:45:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134371 X-Patchwork-Delegate: paul@pwsan.com 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 o7QBkTG5001644 for ; Thu, 26 Aug 2010 11:50:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654Ab0HZLqO (ORCPT ); Thu, 26 Aug 2010 07:46:14 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:44046 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635Ab0HZLqN (ORCPT ); Thu, 26 Aug 2010 07:46:13 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o7QBk8BS015003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Aug 2010 06:46:11 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o7QBk4FH029217; Thu, 26 Aug 2010 17:16:05 +0530 (IST) From: Kishon Vijay Abraham I To: linux-omap@vger.kernel.org Cc: Kishon Vijay Abraham I , Charulatha V , Shubhrajyoti D , Paul Walmsley , Benoit Cousson , Partha Basak Subject: [RFC: PATCH] New API to modify the autoidle bits of sysconfig register Date: Thu, 26 Aug 2010 17:15:55 +0530 Message-Id: <1282823155-18328-1-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.0.4 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 (demeter1.kernel.org [140.211.167.41]); Thu, 26 Aug 2010 11:50:59 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 9bd99ad..0d38404 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -969,6 +969,35 @@ int _omap_hwmod_idle(struct omap_hwmod *oh) } /** + * omap_hwmod_set_module_autoidle - set the hwmod's OCP slave autoidle + * @oh: struct omap_hwmod * + * @autoidle: desired AUTOIDLE bitfield value (0 or 1) + * + * Sets the IP block's OCP slave autoidle in hardware, and updates our + * local copy. Intended to be used by drivers that have some erratum + * that requires direct manipulation of the AUTOIDLE bits. Returns + * -EINVAL if @oh is null, or passes along the return value from + * _set_module_autoidle(). + */ +int omap_hwmod_set_module_autoidle(struct omap_hwmod *oh, u8 autoidle) +{ + u32 v; + int retval = 0; + + if (!oh) + return -EINVAL; + + v = oh->_sysc_cache; + + retval = _set_module_autoidle(oh, autoidle, &v); + + if (!retval) + _write_sysconfig(v, oh); + + return retval; +} + +/** * _shutdown - shutdown an omap_hwmod * @oh: struct omap_hwmod * * diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 6adbb63..7042b86 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -526,6 +526,7 @@ int omap_hwmod_hardreset_deassert(struct omap_hwmod *oh, const char *name); int omap_hwmod_hardreset_state(struct omap_hwmod *oh, const char *name); int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode); +int omap_hwmod_set_module_autoidle(struct omap_hwmod *oh, u8 autoidle) int omap_hwmod_reset(struct omap_hwmod *oh); void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);