From patchwork Wed Aug 18 14:10:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalliguddi, Hema" X-Patchwork-Id: 120169 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 o7IEB9tn000998 for ; Wed, 18 Aug 2010 14:11:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753409Ab0HROLF (ORCPT ); Wed, 18 Aug 2010 10:11:05 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:51830 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753335Ab0HROLD (ORCPT ); Wed, 18 Aug 2010 10:11:03 -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 o7IEAtbl016941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Aug 2010 09:10:58 -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 o7IEArD4015829; Wed, 18 Aug 2010 19:40:53 +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 o7IEAqx7029934; Wed, 18 Aug 2010 19:40:52 +0530 Received: (from a0876481@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o7IEAqmo029930; Wed, 18 Aug 2010 19:40:52 +0530 From: Hema HK To: linux-omap@vger.kernel.org, linux-usb@vger.kernel.org Cc: Hema HK , "Basak, Partha" , Felipe Balbi , Tony Lindgren , Kevin Hilman , "Cousson, Benoit" , Paul Walmsley Subject: [PATCH 7/8 v2] OMAP: Hwmod api changes Date: Wed, 18 Aug 2010 19:40:52 +0530 Message-Id: <1282140652-29837-1-git-send-email-hemahk@ti.com> X-Mailer: git-send-email 1.5.6.6 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, 18 Aug 2010 14:11:09 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 9bd99ad..55507a6 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwmod *oh) _set_master_standbymode(oh, idlemode, &v); } - if (sf & SYSC_HAS_AUTOIDLE) { - idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ? - 0 : 1; - _set_module_autoidle(oh, idlemode, &v); - } - /* XXX OCP ENAWAKEUP bit? */ /* @@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwmod *oh) _set_clockactivity(oh, oh->class->sysc->clockact, &v); _write_sysconfig(v, oh); + + /* Set the auto idle bit only after setting the smartidle bit + * as this is requirement for some modules like USBOTG + * setting this will not have any impact on the other modues. + */ + + if (sf & SYSC_HAS_AUTOIDLE) { + idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ? + 0 : 1; + _set_module_autoidle(oh, idlemode, &v); + } + _write_sysconfig(v, oh); } /** diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 25cd9ac..c3eb07e 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -116,6 +116,8 @@ int omap_device_enable_hwmods(struct omap_device *od); int omap_device_disable_clocks(struct omap_device *od); int omap_device_enable_clocks(struct omap_device *od); +int omap_device_enable_wakeup(struct platform_device *pdev); +int omap_device_disable_wakeup(struct platform_device *pdev); /* * Entries should be kept in latency order ascending diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index d2b1609..10182b1 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -757,3 +757,46 @@ int omap_device_enable_clocks(struct omap_device *od) /* XXX pass along return value here? */ return 0; } + +/** + * omap_device_enable_wakeup - Enable the wakeup bit + * @od: struct omap_device *od + * + * Enable the wakup bit for omap_hwmods associated + * with the omap_device. Returns 0. + */ +int omap_device_enable_wakeup(struct platform_device *pdev) +{ + struct omap_hwmod *oh; + struct omap_device *od = _find_by_pdev(pdev); + int i; + + for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) + omap_hwmod_enable_wakeup(oh); + + /* XXX pass along return value here? */ + return 0; +} + +/** + * omap_device_disable_wakeup -Disable the wakeup bit + * @od: struct omap_device *od + * + * Disable the wakup bit for omap_hwmods associated + * with the omap_device. Returns 0. + */ + + +int omap_device_disable_wakeup(struct platform_device *pdev) +{ + struct omap_hwmod *oh; + struct omap_device *od = _find_by_pdev(pdev); + int i; + + for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) + omap_hwmod_disable_wakeup(oh); + + /* XXX pass along return value here? */ + return 0; +} +