From patchwork Thu Mar 10 09:32:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kalle.jokiniemi@nokia.com X-Patchwork-Id: 623931 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 p2A9Yfrb011524 for ; Thu, 10 Mar 2011 09:34:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331Ab1CJJel (ORCPT ); Thu, 10 Mar 2011 04:34:41 -0500 Received: from smtp.nokia.com ([147.243.128.26]:17653 "EHLO mgw-da02.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250Ab1CJJej (ORCPT ); Thu, 10 Mar 2011 04:34:39 -0500 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da02.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p2A9YaW3028833; Thu, 10 Mar 2011 11:34:36 +0200 Received: from kalle-t43.nmp.nokia.com ([trdhcp215135.nmp.nokia.com [172.22.215.135]]) by mgw-da02.nokia.com with RELAY id p2A9Y9o6028310 ; Thu, 10 Mar 2011 11:34:14 +0200 From: Kalle Jokiniemi To: paul@pwsan.com, khilman@ti.com, linux-omap@vger.kernel.org Cc: ilkka.koskinen@nokia.com, jhnikula@gmail.com, b-cousson@ti.com, Kalle Jokiniemi Subject: [PATCH 1/2] OMAP: hw_mod: consider supported idlemodes in enable_sysc Date: Thu, 10 Mar 2011 11:32:48 +0200 Message-Id: <1299749569-22673-2-git-send-email-kalle.jokiniemi@nokia.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299749569-22673-1-git-send-email-kalle.jokiniemi@nokia.com> References: <1299749569-22673-1-git-send-email-kalle.jokiniemi@nokia.com> MIME-Version: 1.0 X-Nokia-AV: Clean 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]); Thu, 10 Mar 2011 09:34:44 +0000 (UTC) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 028efda..ef77697 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -757,7 +757,7 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index) */ static void _enable_sysc(struct omap_hwmod *oh) { - u8 idlemode, sf; + u8 idlemode, sf, idlemode_flags; u32 v; if (!oh->class->sysc) @@ -765,17 +765,28 @@ static void _enable_sysc(struct omap_hwmod *oh) v = oh->_sysc_cache; sf = oh->class->sysc->sysc_flags; + idlemode_flags = oh->class->sysc->idlemodes; + + /* Set the idlemode, priority order: 1. SMART 2. FORCE 3. NOIDLE */ + if (idlemode_flags & SIDLE_SMART) + idlemode = HWMOD_IDLEMODE_SMART; + else if (idlemode_flags & SIDLE_FORCE) + idlemode = HWMOD_IDLEMODE_FORCE; + else + idlemode = HWMOD_IDLEMODE_NO; if (sf & SYSC_HAS_SIDLEMODE) { - idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? - HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; - _set_slave_idlemode(oh, idlemode, &v); + if (oh->flags & HWMOD_SWSUP_SIDLE) + _set_slave_idlemode(oh, HWMOD_IDLEMODE_NO, &v); + else + _set_slave_idlemode(oh, idlemode, &v); } if (sf & SYSC_HAS_MIDLEMODE) { - idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? - HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; - _set_master_standbymode(oh, idlemode, &v); + if (oh->flags & HWMOD_SWSUP_MSTANDBY) + _set_master_standbymode(oh, HWMOD_IDLEMODE_NO, &v); + else + _set_master_standbymode(oh, idlemode, &v); } /* @@ -788,7 +799,8 @@ static void _enable_sysc(struct omap_hwmod *oh) _set_clockactivity(oh, oh->class->sysc->clockact, &v); /* If slave is in SMARTIDLE, also enable wakeup */ - if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE)) + if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE) && + idlemode_flags & SIDLE_SMART) _enable_wakeup(oh, &v); _write_sysconfig(v, oh);