blob: 15e567612b361e334139b03d5b17a10fb6f60f99 [file] [log] [blame]
Manish Dewangan221ac642012-07-09 14:26:26 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef QDSP5AUDPREPROC_H
14#define _QDSP5AUDPREPROC_H
15
16#include <mach/qdsp5/qdsp5audpreproccmdi.h>
17#include <mach/qdsp5/qdsp5audpreprocmsg.h>
18
19#define MSM_AUD_ENC_MODE_TUNNEL 0x00000100
20#define MSM_AUD_ENC_MODE_NONTUNNEL 0x00000200
21
22#define AUDPREPROC_CODEC_MASK 0x00FF
23#define AUDPREPROC_MODE_MASK 0xFF00
24
25#define MSM_ADSP_ENC_MODE_TUNNEL 24
26#define MSM_ADSP_ENC_MODE_NON_TUNNEL 25
27
Manish Dewangan221ac642012-07-09 14:26:26 +053028/* event callback routine prototype*/
29typedef void (*audpreproc_event_func)(void *private, unsigned id, void *msg);
30
31struct audpreproc_event_callback {
32 audpreproc_event_func fn;
33 void *private;
34};
35
36/*holds audrec information*/
37struct audrec_session_info {
38 int session_id;
39 int sampling_freq;
40};
41
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042/* Exported common api's from audpreproc layer */
43int audpreproc_aenc_alloc(unsigned enc_type, const char **module_name,
44 unsigned *queue_id);
45void audpreproc_aenc_free(int enc_id);
46
Manish Dewangan221ac642012-07-09 14:26:26 +053047int audpreproc_enable(int enc_id, audpreproc_event_func func, void *private);
48void audpreproc_disable(int enc_id, void *private);
49
50int audpreproc_unregister_event_callback(struct audpreproc_event_callback *ecb);
51
52int audpreproc_register_event_callback(struct audpreproc_event_callback *ecb);
53
54int audpreproc_update_audrec_info(struct audrec_session_info
55 *audrec_session_info);
56int get_audrec_session_info(struct audrec_session_info *info);
57
58int audpreproc_dsp_set_agc(audpreproc_cmd_cfg_agc_params *agc,
59 unsigned len);
60int audpreproc_dsp_set_ns(audpreproc_cmd_cfg_ns_params *ns,
61 unsigned len);
62int audpreproc_dsp_set_iir(audpreproc_cmd_cfg_iir_tuning_filter_params *iir,
63 unsigned len);
64
65int audpreproc_send_preproccmdqueue(void *cmd, unsigned len);
66
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070067#endif /* QDSP5AUDPREPROC_H */