1 /* arch/arm/mach-msm/qdsp5/audmgr.h
3 * Copyright 2008 (c) QUALCOMM Incorporated.
4 * Copyright (C) 2008 Google, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #ifndef _ARCH_ARM_MACH_MSM_AUDMGR_H
18 #define _ARCH_ARM_MACH_MSM_AUDMGR_H
20 #if CONFIG_MSM_AMSS_VERSION==6350
21 #include "audmgr_new.h"
24 enum rpc_aud_def_sample_rate_type
{
25 RPC_AUD_DEF_SAMPLE_RATE_NONE
,
26 RPC_AUD_DEF_SAMPLE_RATE_8000
,
27 RPC_AUD_DEF_SAMPLE_RATE_11025
,
28 RPC_AUD_DEF_SAMPLE_RATE_12000
,
29 RPC_AUD_DEF_SAMPLE_RATE_16000
,
30 RPC_AUD_DEF_SAMPLE_RATE_22050
,
31 RPC_AUD_DEF_SAMPLE_RATE_24000
,
32 RPC_AUD_DEF_SAMPLE_RATE_32000
,
33 RPC_AUD_DEF_SAMPLE_RATE_44100
,
34 RPC_AUD_DEF_SAMPLE_RATE_48000
,
35 RPC_AUD_DEF_SAMPLE_RATE_MAX
,
38 enum rpc_aud_def_method_type
{
39 RPC_AUD_DEF_METHOD_NONE
,
40 RPC_AUD_DEF_METHOD_KEY_BEEP
,
41 RPC_AUD_DEF_METHOD_PLAYBACK
,
42 RPC_AUD_DEF_METHOD_VOICE
,
43 RPC_AUD_DEF_METHOD_RECORD
,
44 RPC_AUD_DEF_METHOD_HOST_PCM
,
45 RPC_AUD_DEF_METHOD_MIDI_OUT
,
46 RPC_AUD_DEF_METHOD_RECORD_SBC
,
47 RPC_AUD_DEF_METHOD_DTMF_RINGER
,
48 RPC_AUD_DEF_METHOD_MAX
,
51 enum rpc_aud_def_codec_type
{
52 RPC_AUD_DEF_CODEC_NONE
,
53 RPC_AUD_DEF_CODEC_DTMF
,
54 RPC_AUD_DEF_CODEC_MIDI
,
55 RPC_AUD_DEF_CODEC_MP3
,
56 RPC_AUD_DEF_CODEC_PCM
,
57 RPC_AUD_DEF_CODEC_AAC
,
58 RPC_AUD_DEF_CODEC_WMA
,
60 RPC_AUD_DEF_CODEC_ADPCM
,
61 RPC_AUD_DEF_CODEC_GAUDIO
,
62 RPC_AUD_DEF_CODEC_VOC_EVRC
,
63 RPC_AUD_DEF_CODEC_VOC_13K
,
64 RPC_AUD_DEF_CODEC_VOC_4GV_NB
,
65 RPC_AUD_DEF_CODEC_VOC_AMR
,
66 RPC_AUD_DEF_CODEC_VOC_EFR
,
67 RPC_AUD_DEF_CODEC_VOC_FR
,
68 RPC_AUD_DEF_CODEC_VOC_HR
,
69 RPC_AUD_DEF_CODEC_VOC
,
70 RPC_AUD_DEF_CODEC_SBC
,
71 RPC_AUD_DEF_CODEC_VOC_PCM
,
72 RPC_AUD_DEF_CODEC_AMR_WB
,
73 RPC_AUD_DEF_CODEC_AMR_WB_PLUS
,
74 RPC_AUD_DEF_CODEC_MAX
,
77 enum rpc_snd_method_type
{
78 RPC_SND_METHOD_VOICE
= 0,
79 RPC_SND_METHOD_KEY_BEEP
,
80 RPC_SND_METHOD_MESSAGE
,
87 enum rpc_voc_codec_type
{
88 RPC_VOC_CODEC_DEFAULT
,
89 RPC_VOC_CODEC_ON_CHIP_0
= RPC_VOC_CODEC_DEFAULT
,
90 RPC_VOC_CODEC_ON_CHIP_1
,
91 RPC_VOC_CODEC_STEREO_HEADSET
,
92 RPC_VOC_CODEC_ON_CHIP_AUX
,
93 RPC_VOC_CODEC_BT_OFF_BOARD
,
94 RPC_VOC_CODEC_BT_A2DP
,
95 RPC_VOC_CODEC_OFF_BOARD
,
97 RPC_VOC_CODEC_RX_EXT_SDAC_TX_INTERNAL
,
98 RPC_VOC_CODEC_IN_STEREO_SADC_OUT_MONO_HANDSET
,
99 RPC_VOC_CODEC_IN_STEREO_SADC_OUT_STEREO_HEADSET
,
100 RPC_VOC_CODEC_TX_INT_SADC_RX_EXT_AUXPCM
,
101 RPC_VOC_CODEC_EXT_STEREO_SADC_OUT_MONO_HANDSET
,
102 RPC_VOC_CODEC_EXT_STEREO_SADC_OUT_STEREO_HEADSET
,
103 RPC_VOC_CODEC_TTY_ON_CHIP_1
,
104 RPC_VOC_CODEC_TTY_OFF_BOARD
,
105 RPC_VOC_CODEC_TTY_VCO
,
106 RPC_VOC_CODEC_TTY_HCO
,
107 RPC_VOC_CODEC_ON_CHIP_0_DUAL_MIC
,
112 enum rpc_audmgr_status_type
{
113 RPC_AUDMGR_STATUS_READY
,
114 RPC_AUDMGR_STATUS_CODEC_CONFIG
,
115 RPC_AUDMGR_STATUS_PENDING
,
116 RPC_AUDMGR_STATUS_SUSPEND
,
117 RPC_AUDMGR_STATUS_FAILURE
,
118 RPC_AUDMGR_STATUS_VOLUME_CHANGE
,
119 RPC_AUDMGR_STATUS_DISABLED
,
120 RPC_AUDMGR_STATUS_ERROR
,
123 struct rpc_audmgr_enable_client_args
{
125 uint32_t tx_sample_rate
;
126 uint32_t rx_sample_rate
;
132 uint32_t client_data
;
135 #define AUDMGR_ENABLE_CLIENT 2
136 #define AUDMGR_DISABLE_CLIENT 3
137 #define AUDMGR_SUSPEND_EVENT_RSP 4
138 #define AUDMGR_REGISTER_OPERATION_LISTENER 5
139 #define AUDMGR_UNREGISTER_OPERATION_LISTENER 6
140 #define AUDMGR_REGISTER_CODEC_LISTENER 7
141 #define AUDMGR_GET_RX_SAMPLE_RATE 8
142 #define AUDMGR_GET_TX_SAMPLE_RATE 9
143 #define AUDMGR_SET_DEVICE_MODE 10
145 #if CONFIG_MSM_AMSS_VERSION < 6220
146 #define AUDMGR_PROG_VERS "rs30000013:46255756"
147 #define AUDMGR_PROG 0x30000013
148 #define AUDMGR_VERS 0x46255756
150 #define AUDMGR_PROG_VERS "rs30000013:e94e8f0c"
151 #define AUDMGR_PROG 0x30000013
152 #define AUDMGR_VERS 0xe94e8f0c
155 struct rpc_audmgr_cb_func_ptr
{
166 #define AUDMGR_CB_FUNC_PTR 1
167 #define AUDMGR_OPR_LSTNR_CB_FUNC_PTR 2
168 #define AUDMGR_CODEC_LSTR_FUNC_PTR 3
170 #if CONFIG_MSM_AMSS_VERSION < 6220
171 #define AUDMGR_CB_PROG 0x31000013
172 #define AUDMGR_CB_VERS 0x5fa922a9
174 #define AUDMGR_CB_PROG 0x31000013
175 #define AUDMGR_CB_VERS 0x21570ba7
179 wait_queue_head_t wait
;
181 struct msm_rpc_endpoint
*ept
;
182 struct task_struct
*task
;
186 struct audmgr_config
{
194 int audmgr_open(struct audmgr
*am
);
195 int audmgr_close(struct audmgr
*am
);
196 int audmgr_enable(struct audmgr
*am
, struct audmgr_config
*cfg
);
197 int audmgr_disable(struct audmgr
*am
);
199 typedef void (*audpp_event_func
)(void *private, unsigned id
, uint16_t *msg
);
201 int audpp_enable(int id
, audpp_event_func func
, void *private);
202 void audpp_disable(int id
, void *private);
204 int audpp_send_queue1(void *cmd
, unsigned len
);
205 int audpp_send_queue2(void *cmd
, unsigned len
);
206 int audpp_send_queue3(void *cmd
, unsigned len
);
208 int audpp_pause(unsigned id
, int pause
);
209 int audpp_set_volume_and_pan(unsigned id
, unsigned volume
, int pan
);
210 void audpp_avsync(int id
, unsigned rate
);
211 unsigned audpp_avsync_sample_count(int id
);
212 unsigned audpp_avsync_byte_count(int id
);