From patchwork Wed Jan 9 15:03:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastien Guiriec X-Patchwork-Id: 1953181 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6C2794020F for ; Wed, 9 Jan 2013 15:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758025Ab3AIPDc (ORCPT ); Wed, 9 Jan 2013 10:03:32 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:39139 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757987Ab3AIPDb (ORCPT ); Wed, 9 Jan 2013 10:03:31 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r09F3L1j008767; Wed, 9 Jan 2013 09:03:21 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r09F3Lb1012802; Wed, 9 Jan 2013 09:03:21 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 9 Jan 2013 09:03:21 -0600 Received: from unb0919150.emea.dhcp.ti.com (unb0919150.emea.dhcp.ti.com [137.167.110.144]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r09F3FJI007913; Wed, 9 Jan 2013 09:03:19 -0600 From: Sebastien Guiriec To: Sebastien Guiriec , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Paul Walmsley , Tony Lindgren , CC: , Peter Ujfalusi , Liam Girdwood , Tero Kristo , Jon Hunter , Mark Brown Subject: [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code Date: Wed, 9 Jan 2013 16:03:08 +0100 Message-ID: <1357743792-13917-3-git-send-email-s-guiriec@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357743792-13917-1-git-send-email-s-guiriec@ti.com> References: <1357743792-13917-1-git-send-email-s-guiriec@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Paul Walmsley Add a basic header file for the TI AESS IP block, located in the OMAP4 Audio Back-End subsystem. Currently, this header file only contains a function to enable the AESS internal clock auto-gating. This will be used by a subsequent patch to ensure that the AESS won't block the entire chip low-power-idle mode. We wish to be able to place the AESS into idle even when no AESS driver has been compiled in. Signed-off-by: Paul Walmsley Cc: Liam Girdwood Cc: Mark Brown Cc: Péter Ujfalusi Cc: Tony Lindgren Acked-by: Mark Brown --- include/sound/aess.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/sound/aess.h diff --git a/include/sound/aess.h b/include/sound/aess.h new file mode 100644 index 0000000..cee0d09 --- /dev/null +++ b/include/sound/aess.h @@ -0,0 +1,53 @@ +/* + * AESS IP block reset + * + * Copyright (C) 2012 Texas Instruments, Inc. + * Paul Walmsley + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#ifndef __SOUND_AESS_H__ +#define __SOUND_AESS_H__ + +#include +#include + +/* + * AESS_AUTO_GATING_ENABLE_OFFSET: offset in bytes of the AESS IP + * block's AESS_AUTO_GATING_ENABLE__1 register from the IP block's + * base address + */ +#define AESS_AUTO_GATING_ENABLE_OFFSET 0x07c + +/* Register bitfields in the AESS_AUTO_GATING_ENABLE__1 register */ +#define AESS_AUTO_GATING_ENABLE_SHIFT 0 + +/** + * aess_enable_autogating - enable AESS internal autogating + * @oh: struct omap_hwmod * + * + * Enable internal autogating on the AESS. This allows the AESS to + * indicate that it is idle to the OMAP PRCM. Returns 0. + */ +static inline void aess_enable_autogating(void __iomem *base) +{ + u32 v; + + /* Set AESS_AUTO_GATING_ENABLE__1.ENABLE to allow idle entry */ + v = 1 << AESS_AUTO_GATING_ENABLE_SHIFT; + writel(v, base + AESS_AUTO_GATING_ENABLE_OFFSET); +} + +#endif /* __SOUND_AESS_H__ */