3
This file is provided under a dual BSD/GPLv2 license. When using or
4
redistributing this file, you may do so under either license.
8
Copyright(c) 2010-2011 Texas Instruments Incorporated,
11
This program is free software; you can redistribute it and/or modify
12
it under the terms of version 2 of the GNU General Public License as
13
published by the Free Software Foundation.
15
This program is distributed in the hope that it will be useful, but
16
WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23
The full GNU General Public License is included in this distribution
24
in the file called LICENSE.GPL.
28
Copyright(c) 2010-2011 Texas Instruments Incorporated,
31
Redistribution and use in source and binary forms, with or without
32
modification, are permitted provided that the following conditions
35
* Redistributions of source code must retain the above copyright
36
notice, this list of conditions and the following disclaimer.
37
* Redistributions in binary form must reproduce the above copyright
38
notice, this list of conditions and the following disclaimer in
39
the documentation and/or other materials provided with the
41
* Neither the name of Texas Instruments Incorporated nor the names of
42
its contributors may be used to endorse or promote products derived
43
from this software without specific prior written permission.
45
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
#include <linux/module.h>
63
#include <linux/moduleparam.h>
64
#include <linux/init.h>
65
#include <linux/err.h>
66
#include <linux/slab.h>
70
#include "abe_define.h"
78
#define MAX_UINT8 ((((1L << 7) - 1) << 1) + 1)
79
#define MAX_UINT16 ((((1L << 15) - 1) << 1) + 1)
80
#define MAX_UINT32 ((((1L << 31) - 1) << 1) + 1)
83
#define u8 unsigned char
85
#define u16 unsigned short
87
#define u32 unsigned int
95
/* parameters are the direct and recursive coefficients in */
96
/* Q6.26 integer fixed-point format. */
99
/* center frequency of the band [Hz] */
101
/* gain of each band. [dB] */
103
/* Q factor of this band [dB] */
111
void __iomem *io_base[5];
112
u32 firmware_version_number;
113
u16 MultiFrame[PROCESSING_SLOTS][TASKS_IN_SLOT];
114
u32 compensated_mixer_gain;
115
u8 muted_gains_indicator[MAX_NBGAIN_CMEM];
116
u32 desired_gains_decibel[MAX_NBGAIN_CMEM];
117
u32 muted_gains_decibel[MAX_NBGAIN_CMEM];
118
u32 desired_gains_linear[MAX_NBGAIN_CMEM];
119
u32 desired_ramp_delay_ms[MAX_NBGAIN_CMEM];
123
u32 irq_dbg_read_ptr;
125
struct omap_abe_dbg dbg;
128
extern struct omap_abe *abe;
130
void omap_abe_dbg_log(struct omap_abe *abe, u32 x, u32 y, u32 z, u32 t);
131
void omap_abe_dbg_error(struct omap_abe *abe, int level, int error);
132
int omap_abe_set_opp_processing(struct omap_abe *abe, u32 opp);
133
int omap_abe_connect_debug_trace(struct omap_abe *abe,
134
struct omap_abe_dma *dma2);
136
int omap_abe_use_compensated_gain(struct omap_abe *abe, int on_off);
137
int omap_abe_write_equalizer(struct omap_abe *abe,
138
u32 id, struct omap_abe_equ *param);
140
int omap_abe_disable_gain(struct omap_abe *abe, u32 id, u32 p);
141
int omap_abe_enable_gain(struct omap_abe *abe, u32 id, u32 p);
142
int omap_abe_mute_gain(struct omap_abe *abe, u32 id, u32 p);
143
int omap_abe_unmute_gain(struct omap_abe *abe, u32 id, u32 p);
145
int omap_abe_write_gain(struct omap_abe *abe,
146
u32 id, s32 f_g, u32 ramp, u32 p);
147
int omap_abe_write_mixer(struct omap_abe *abe,
148
u32 id, s32 f_g, u32 f_ramp, u32 p);
149
int omap_abe_read_gain(struct omap_abe *abe,
150
u32 id, u32 *f_g, u32 p);
151
int omap_abe_read_mixer(struct omap_abe *abe,
152
u32 id, u32 *f_g, u32 p);
157
#define _log(x, y, z, t) { if (x & abe->dbg.mask) omap_abe_dbg_log(abe, x, y, z, t); }