| /*-------------------------------------------------------------------------------------------------------------------- |
| * (C) Copyright 2011 Marvell Technology Group Ltd. All Rights Reserved. |
| * -------------------------------------------------------------------------------------------------------------------*/ |
| /****************************************************************************** |
| * MODULE IMPLEMENTATION FILE |
| * ******************************************************************************* |
| * * Title: encapsulate alsa control interface |
| * * |
| * * Filename: MarvellVoiceAmixer.h |
| * * |
| * * Authors: |
| * * |
| * * Description: header file for encapsulating control plugin. |
| * * |
| * * Last Updated : |
| * * |
| * * Notes: |
| * ******************************************************************************/ |
| |
| #ifndef __MARVELL_VOICE_AMIXER_H__ |
| #define __MARVELL_VOICE_AMIXER_H__ |
| |
| #include <stdint.h> |
| #include "vcm_protocol.h" |
| |
| #define MIXER_CTL_ANDROID_NUM (VOICE_MIXER_NUM - MIXER_UI_CALIBRATION_TEST) |
| #define MIXER_UI_CALIBRATION_TEST 1 |
| #define VOICE_MIXER_NUM (sizeof(gItemVoiceCtlInfo)/sizeof(gItemVoiceCtlInfo[0])) |
| |
| static const struct |
| { |
| int client; |
| int methodType; |
| int methodId; |
| int device; |
| } gItemVoiceCtlInfo[] = |
| { |
| /*OUTPUT DEVICE*/ |
| /*speaker control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, SPEAKER_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, SPEAKER_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, SPEAKER_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, SPEAKER_DEVICE }, |
| |
| /*earpiece control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, EARPIECE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, EARPIECE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, EARPIECE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, EARPIECE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DHA_SET, EARPIECE_DEVICE }, |
| |
| /*headset control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, HEADSET_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, HEADSET_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, HEADSET_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, HEADSET_DEVICE }, |
| |
| /*headphone control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, HEADPHONE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, HEADPHONE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, HEADPHONE_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, HEADPHONE_DEVICE }, |
| |
| /*bluetooth control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, BLUETOOTH_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, BLUETOOTH_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, BLUETOOTH_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, BLUETOOTH_DEVICE }, |
| |
| //BT NREC |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_ENABLE, BT_NREC_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_DISABLE, BT_NREC_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_VOLUME_SET, BT_NREC_DEVICE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_MUTE, BT_NREC_DEVICE }, |
| |
| /*STREAM CONTROL*/ |
| /*voice playback control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_ENABLE, VOICESTREAMPLAYBACK }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_DISABLE, VOICESTREAMPLAYBACK }, |
| |
| /*voice capture control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_ENABLE, VOICESTREAMCAPTURE }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_DISABLE, VOICESTREAMCAPTURE }, |
| |
| /*voice playback and capture control*/ |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_ENABLE, (VOICESTREAMPLAYBACK | VOICESTREAMCAPTURE) }, |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_WRITE, VCM_METHOD_STREAM_DISABLE, (VOICESTREAMPLAYBACK | VOICESTREAMCAPTURE) }, |
| |
| { VCM_PHONE_CLIENT, VCM_PLUGIN_CTL_READ, VCM_METHOD_GET_WBNB, 0}, |
| |
| /* dummy for UI calibration */ |
| { VCM_CALIBRATION_CLIENT, VCM_PLUGIN_CALIBRATE_MSA, 0, 0}, |
| |
| }; |
| |
| int voice_route_control(int client, int method_type, int method_id, int device, unsigned int outputMsaGain, unsigned int inputMsaGain, unsigned int optionParam); |
| int voice_get_parameter(int client, int method_type, int method_id, int device, unsigned int* values, int count); |
| |
| #endif |