From patchwork Fri Jul 1 08:52:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 934992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p618rBsE005093 for ; Fri, 1 Jul 2011 08:53:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755757Ab1GAIxM (ORCPT ); Fri, 1 Jul 2011 04:53:12 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:58452 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755751Ab1GAIxL (ORCPT ); Fri, 1 Jul 2011 04:53:11 -0400 Received: by mail-bw0-f46.google.com with SMTP id 5so2453487bwd.19 for ; Fri, 01 Jul 2011 01:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=D4pO/rureObSWCUQb7bTiqvgd/FfG1dF4kiH5aQj0mE=; b=hXk6LgLd12ufLfvc1Wu36JtFm+YlhlNszT9oXJTlRUlcNoaydj+djq0bqL5pzWxTAs MC9VOKLLmMoTRjPVpFZnIhYihFuh3zQgWYK+D5CnWNisrHMeOLS6cu8NgkU211MgGOq0 o4rk19eR1SCztp7l/X2UUiulFjXYkQdd3wuZk= Received: by 10.204.163.129 with SMTP id a1mr2931460bky.85.1309510390494; Fri, 01 Jul 2011 01:53:10 -0700 (PDT) Received: from localhost (host-94-101-4-66.igua.fi [94.101.4.66]) by mx.google.com with ESMTPS id e6sm2813176bka.11.2011.07.01.01.53.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jul 2011 01:53:09 -0700 (PDT) From: Jarkko Nikula To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Janusz Krzysztofik , Peter Ujfalusi , Jarkko Nikula Subject: [RFC 09/12] omap: mcbsp: Move OMAP3+ wakeup enable/disable to omap_mcbsp_request/_free Date: Fri, 1 Jul 2011 11:52:33 +0300 Message-Id: <1309510356-27147-10-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1309510356-27147-1-git-send-email-jhnikula@gmail.com> References: <1309510356-27147-1-git-send-email-jhnikula@gmail.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 (demeter2.kernel.org [140.211.167.43]); Fri, 01 Jul 2011 08:53:14 +0000 (UTC) There are only enable/disable wakeup behavior code left in omap34xx_mcbsp_request/_free after hwmod conversion so it can be well moved to generic omap_mcbsp_request/_free. Remove also old comments about idle mode settings and HW bug workarounds that were not updated during hwmod conversion. Signed-off-by: Jarkko Nikula --- arch/arm/plat-omap/mcbsp.c | 43 +++++++++---------------------------------- 1 files changed, 9 insertions(+), 34 deletions(-) diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 7511287..202292a 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c @@ -667,35 +667,7 @@ int omap_mcbsp_get_dma_op_mode(unsigned int id) } EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode); -static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) -{ - /* - * Enable wakup behavior, smart idle and all wakeups - * REVISIT: some wakeups may be unnecessary - */ - if (mcbsp->mcbsp_config_type >= MCBSP_CONFIG_TYPE3) { - MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); - } -} - -static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) -{ - /* - * Disable wakup behavior, smart idle and all wakeups - */ - if (mcbsp->mcbsp_config_type >= MCBSP_CONFIG_TYPE3) { - /* - * HW bug workaround - If no_idle mode is taken, we need to - * go to smart_idle before going to always_idle, or the - * device will not hit retention anymore. - */ - - MCBSP_WRITE(mcbsp, WAKEUPEN, 0); - } -} #else -static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) {} -static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) {} static inline void omap_st_start(struct omap_mcbsp *mcbsp) {} static inline void omap_st_stop(struct omap_mcbsp *mcbsp) {} #endif @@ -734,8 +706,9 @@ int omap_mcbsp_request(unsigned int id) pm_runtime_get_sync(mcbsp->dev); - /* Do procedure specific to omap34xx arch, if applicable */ - omap34xx_mcbsp_request(mcbsp); + /* Enable wakup behavior */ + if (mcbsp->mcbsp_config_type >= MCBSP_CONFIG_TYPE3) + MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); /* * Make sure that transmitter, receiver and sample-rate generator are @@ -772,8 +745,9 @@ err_clk_disable: if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) mcbsp->pdata->ops->free(id); - /* Do procedure specific to omap34xx arch, if applicable */ - omap34xx_mcbsp_free(mcbsp); + /* Disable wakup behavior */ + if (mcbsp->mcbsp_config_type >= MCBSP_CONFIG_TYPE3) + MCBSP_WRITE(mcbsp, WAKEUPEN, 0); pm_runtime_put_sync(mcbsp->dev); @@ -802,8 +776,9 @@ void omap_mcbsp_free(unsigned int id) if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) mcbsp->pdata->ops->free(id); - /* Do procedure specific to omap34xx arch, if applicable */ - omap34xx_mcbsp_free(mcbsp); + /* Disable wakup behavior */ + if (mcbsp->mcbsp_config_type >= MCBSP_CONFIG_TYPE3) + MCBSP_WRITE(mcbsp, WAKEUPEN, 0); pm_runtime_put_sync(mcbsp->dev);