Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 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 Dewangan | 221ac64 | 2012-07-09 14:26:26 +0530 | [diff] [blame] | 28 | /* event callback routine prototype*/ |
| 29 | typedef void (*audpreproc_event_func)(void *private, unsigned id, void *msg); |
| 30 | |
| 31 | struct audpreproc_event_callback { |
| 32 | audpreproc_event_func fn; |
| 33 | void *private; |
| 34 | }; |
| 35 | |
| 36 | /*holds audrec information*/ |
| 37 | struct audrec_session_info { |
| 38 | int session_id; |
| 39 | int sampling_freq; |
| 40 | }; |
| 41 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | /* Exported common api's from audpreproc layer */ |
| 43 | int audpreproc_aenc_alloc(unsigned enc_type, const char **module_name, |
| 44 | unsigned *queue_id); |
| 45 | void audpreproc_aenc_free(int enc_id); |
| 46 | |
Manish Dewangan | 221ac64 | 2012-07-09 14:26:26 +0530 | [diff] [blame] | 47 | int audpreproc_enable(int enc_id, audpreproc_event_func func, void *private); |
| 48 | void audpreproc_disable(int enc_id, void *private); |
| 49 | |
| 50 | int audpreproc_unregister_event_callback(struct audpreproc_event_callback *ecb); |
| 51 | |
| 52 | int audpreproc_register_event_callback(struct audpreproc_event_callback *ecb); |
| 53 | |
| 54 | int audpreproc_update_audrec_info(struct audrec_session_info |
| 55 | *audrec_session_info); |
| 56 | int get_audrec_session_info(struct audrec_session_info *info); |
| 57 | |
| 58 | int audpreproc_dsp_set_agc(audpreproc_cmd_cfg_agc_params *agc, |
| 59 | unsigned len); |
| 60 | int audpreproc_dsp_set_ns(audpreproc_cmd_cfg_ns_params *ns, |
| 61 | unsigned len); |
| 62 | int audpreproc_dsp_set_iir(audpreproc_cmd_cfg_iir_tuning_filter_params *iir, |
| 63 | unsigned len); |
| 64 | |
| 65 | int audpreproc_send_preproccmdqueue(void *cmd, unsigned len); |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 66 | typedef void (*audrec_event_func)(void *private, unsigned id, uint16_t *msg); |
| 67 | int audrectask_enable(unsigned enc_type, audrec_event_func func, void *private); |
| 68 | void audrectask_disable(unsigned enc_type, void *private); |
| 69 | |
| 70 | int audrectask_send_cmdqueue(void *cmd, unsigned len); |
| 71 | int audrectask_send_bitstreamqueue(void *cmd, unsigned len); |
Manish Dewangan | 221ac64 | 2012-07-09 14:26:26 +0530 | [diff] [blame] | 72 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 73 | #endif /* QDSP5AUDPREPROC_H */ |