| #ifndef __AUDIO_PROTOCOL_H__ |
| #define __AUDIO_PROTOCOL_H__ |
| |
| #include <stdint.h> |
| |
| // Audio path handler clients |
| #define INVALID_CLIENT_TYPE 0xFFFFFFFF |
| #define HIFI_CLIENT 0x00000001 |
| #define VOICE_CLIENT 0x00000002 |
| #define PHONE_CLIENT 0x00000003 |
| #define FMRADIO_CLIENT 0x00000004 |
| #define VOIP_CLIENT 0x00000005 |
| #define VT_CLIENT 0x00000006 |
| |
| // Plugin operation methods |
| #define PLUGIN_CTL_WRITE 0x00000001 |
| #define PLUGIN_CTL_READ 0x00000002 |
| #define PLUGIN_PCM_WRITE 0x00000003 |
| #define PLUGIN_PCM_READ 0x00000004 |
| |
| // Audio path operation methods |
| #define INVALID_METHOD_ID 0xFFFFFFFF |
| #define METHOD_ENABLE 0x00000001 |
| #define METHOD_DISABLE 0x00000002 |
| #define METHOD_MUTE 0x00000003 |
| #define METHOD_VOLUME_SET 0x00000004 |
| #define METHOD_SWITCH 0x00000005 |
| #define METHOD_GET_MSA_GAIN 0x0000000f |
| |
| // amixer ctl devices |
| #define INVALID_DEVICE 0xFFFFFFFF |
| #define EARPIECE_DEVICE 0x00000001 |
| #define SPEAKER_DEVICE 0x00000002 |
| #define BLUETOOTH_DEVICE 0x00000003 |
| #define HEADSET_DEVICE 0x00000004 |
| #define HEADPHONE_DEVICE 0x00000008 |
| #define BT_NREC_DEVICE 0x00000009 |
| #define FORCE_SPEAKER_DEVICE 0x0000000a |
| |
| /*amixer ctl value (32bit) |
| ---------------------------------------------------------- |
| | Bit | Description |
| ---------------------------------------------------------- |
| |31~29 | reserved |
| | 28 | 1:voip/vt WB 0:voip/vt NB |
| | 27 | 1:Extra volume path 0:default path |
| | 26 | 1:sidetone enable, 0:sidetone disable |
| | 25 | 1:loopback enable, 0:loopback disable |
| | 24 | 1:codec rate is 16 kHz, 0:codec rate is 8 kHz |
| | 23 | EC path enable |
| | 22 | 1:mic2 is used, 0:mic2 is not used |
| | 21 | 1:mic1 is used, 0:mic1 is not used |
| | 20 | 1:stereo speaker, 0:mono speaker |
| | 19 | 1:built-in mic is DMIC, 0:built-in mic is AMIC |
| | 18 | 1:codec mode is slave, 0:codec mode is master |
| | 17 | path direction is input |
| | 16 | path direction is output |
| | 15:0 | path volume |
| ---------------------------------------------------------- |
| */ |
| #define OUTPUT 0x00010000 |
| #define INPUT 0x00020000 |
| #define CODEC_SLAVE 0x00040000 |
| #define USE_DMIC 0x00080000 |
| #define STEREO_SPKR 0x00100000 |
| #define USE_MIC1 0x00200000 |
| #define USE_MIC2 0x00400000 |
| #define ECENABLE 0x00800000 |
| #define CODEC_RATE_WB 0x01000000 |
| #define LOOPBACKTEST 0x02000000 |
| #define SIDETONE 0x04000000 |
| /* increase the voice call volume */ |
| #define EXTRA_VOLUME 0x08000000 |
| #define VOIP_WB 0x10000000 |
| #define VT_WB 0x10000000 |
| #define RECOGNITION 0x20000000 |
| #define CODEC_LOOPTEST 0x40000000 |
| |
| #define VOLUME_MASK 0x0000ffff |
| #define PARAM_MASK 0xffff0000 |
| |
| #endif |