Merge tag 'omap-for-v3.9/pm-omap4-signed' of git://git.kernel.org/pub/scm/linux/kerne...
[linux-2.6-block.git] / arch / arm / mach-omap2 / omap_hwmod_reset.c
CommitLineData
c02060d8
PW
1/*
2 * OMAP IP block custom reset and preprogramming stubs
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley
6 *
7 * A small number of IP blocks need custom reset and preprogramming
8 * functions. The stubs in this file provide a standard way for the
9 * hwmod code to call these functions, which are to be located under
10 * drivers/.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation version 2.
15 *
16 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
17 * kind, whether express or implied; without even the implied warranty
18 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 */
26#include <linux/kernel.h>
27
28#include <sound/aess.h>
29
30#include "omap_hwmod.h"
31
32/**
33 * omap_hwmod_aess_preprogram - enable AESS internal autogating
34 * @oh: struct omap_hwmod *
35 *
36 * The AESS will not IdleAck to the PRCM until its internal autogating
37 * is enabled. Since internal autogating is disabled by default after
38 * AESS reset, we must enable autogating after the hwmod code resets
39 * the AESS. Returns 0.
40 */
41int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
42{
43 void __iomem *va;
44
45 va = omap_hwmod_get_mpu_rt_va(oh);
46 if (!va)
47 return -EINVAL;
48
49 aess_enable_autogating(va);
50
51 return 0;
52}