From patchwork Wed Mar 23 18:49:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 656711 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 p2NJ1KPA014692 for ; Wed, 23 Mar 2011 19:01:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932682Ab1CWTBT (ORCPT ); Wed, 23 Mar 2011 15:01:19 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:60769 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932628Ab1CWTBN (ORCPT ); Wed, 23 Mar 2011 15:01:13 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2NJ1BCd030199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Mar 2011 14:01:11 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id p2NJ1B2s004764; Wed, 23 Mar 2011 14:01:11 -0500 (CDT) Received: from localhost (bacab.am.dhcp.ti.com [128.247.77.143]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p2NJ1Bf09253; Wed, 23 Mar 2011 14:01:11 -0500 (CDT) From: Omar Ramirez Luna To: l-o Cc: Omar Ramirez Luna , Fernando Guzman Lugo , Armando Uribe , Felipe Contreras Subject: [PATCH 4/8] staging: tidspbridge: send mbox PM command directly Date: Wed, 23 Mar 2011 12:49:49 -0600 Message-Id: <1300906193-1732-5-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1300906193-1732-1-git-send-email-omar.ramirez@ti.com> References: <1300906193-1732-1-git-send-email-omar.ramirez@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]); Wed, 23 Mar 2011 19:01:21 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index 9595abc..dd035af 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c @@ -156,6 +156,7 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, #endif /* CONFIG_TIDSPBRIDGE_NTFY_PWRERR */ u8 t; unsigned long v; + u32 mbx_msg; u32 pwr_state, target_pwr_state; struct omap_dsp_platform_data *pdata = omap_dspbridge_dev->dev.platform_data; @@ -166,21 +167,19 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, switch (dev_context->brd_state) { case BRD_RUNNING: - omap_mbox_save_ctx(dev_context->mbox); if (dsp_test_sleepstate == PWRDM_POWER_OFF) { - sm_interrupt_dsp(dev_context, MBX_PM_DSPHIBERNATE); + mbx_msg = MBX_PM_DSPHIBERNATE; dev_dbg(bridge, "PM: %s - sent hibernate cmd to DSP\n", __func__); target_pwr_state = PWRDM_POWER_OFF; } else { - sm_interrupt_dsp(dev_context, MBX_PM_DSPRETENTION); + mbx_msg = MBX_PM_DSPRETENTION; target_pwr_state = PWRDM_POWER_RET; } break; case BRD_RETENTION: - omap_mbox_save_ctx(dev_context->mbox); if (dsp_test_sleepstate == PWRDM_POWER_OFF) { - sm_interrupt_dsp(dev_context, MBX_PM_DSPHIBERNATE); + mbx_msg = MBX_PM_DSPHIBERNATE; target_pwr_state = PWRDM_POWER_OFF; } else return 0; @@ -199,6 +198,12 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, return -EPERM; } + omap_mbox_save_ctx(dev_context->mbox); + + status = omap_mbox_msg_send(dev_context->mbox, mbx_msg); + if (status) + return status; + /* Wait for DSP to move into target power state */ v = msecs_to_jiffies(PWRSTST_TIMEOUT) + jiffies; do {