1b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent/* 24b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastava * Copyright (C) 2013-2014 The Android Open Source Project 3b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * 4b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * Licensed under the Apache License, Version 2.0 (the "License"); 5b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * you may not use this file except in compliance with the License. 6b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * You may obtain a copy of the License at 7b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * 8b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * http://www.apache.org/licenses/LICENSE-2.0 9b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * 10b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * Unless required by applicable law or agreed to in writing, software 11b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * distributed under the License is distributed on an "AS IS" BASIS, 12b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * See the License for the specific language governing permissions and 14b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent * limitations under the License. 15b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent */ 16b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent 175bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew George#ifndef AUDIO_PLATFORM_API_H 185bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew George#define AUDIO_PLATFORM_API_H 19b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent 20b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentvoid *platform_init(struct audio_device *adev); 21b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentvoid platform_deinit(void *platform); 22b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentconst char *platform_get_snd_device_name(snd_device_t snd_device); 23299760a41231bd0f6d9991fb189977347365c72bRavi Kumar Alamandavoid platform_add_backend_name(void *platform, char *mixer_path, 24299760a41231bd0f6d9991fb189977347365c72bRavi Kumar Alamanda snd_device_t snd_device); 25b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_get_pcm_device_id(audio_usecase_t usecase, int device_type); 265bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew Georgeint platform_get_snd_device_index(char *snd_device_index_name); 275bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew Georgeint platform_set_snd_device_acdb_id(snd_device_t snd_device, unsigned int acdb_id); 28b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_send_audio_calibration(void *platform, snd_device_t snd_device); 29b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_switch_voice_call_device_pre(void *platform); 3083281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamandaint platform_switch_voice_call_enable_device_config(void *platform, 3183281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamanda snd_device_t out_snd_device, 3283281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamanda snd_device_t in_snd_device); 33b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_switch_voice_call_device_post(void *platform, 34b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent snd_device_t out_snd_device, 35b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent snd_device_t in_snd_device); 3683281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamandaint platform_switch_voice_call_usecase_route_post(void *platform, 3783281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamanda snd_device_t out_snd_device, 3883281a951af159ca00517f6132fab39727b293f5Ravi Kumar Alamanda snd_device_t in_snd_device); 394b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_start_voice_call(void *platform, uint32_t vsid); 404b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_stop_voice_call(void *platform, uint32_t vsid); 41b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_set_voice_volume(void *platform, int volume); 42b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_set_mic_mute(void *platform, bool state); 434b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_get_sample_rate(void *platform, uint32_t *rate); 444b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_set_device_mute(void *platform, bool state, char *dir); 45b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentsnd_device_t platform_get_output_snd_device(void *platform, audio_devices_t devices); 46b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentsnd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_device); 47b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurentint platform_set_hdmi_channels(void *platform, int channel_count); 4847cd4cbdb19543338d5c887e3d7bcd2513c5c3adHaynes Mathew Georgeint platform_edid_get_max_channels(void *platform); 49b23d5286490ad2dc0edf919d52428fa02dc2b2dcEric Laurent 507ff216f80f6e53235b4239c6fb7da9b0d5127738Haynes Mathew George/* returns the latency for a usecase in Us */ 517ff216f80f6e53235b4239c6fb7da9b0d5127738Haynes Mathew Georgeint64_t platform_render_latency(audio_usecase_t usecase); 527ff216f80f6e53235b4239c6fb7da9b0d5127738Haynes Mathew George 534b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_set_incall_recording_session_id(void *platform, 544b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastava uint32_t session_id, int rec_mode); 554b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_stop_incall_recording_usecase(void *platform); 564b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_start_incall_music_usecase(void *platform); 574b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastavaint platform_stop_incall_music_usecase(void *platform); 584b89e37ad290ef955abf8ac1d151728303311345Vineeta Srivastava 5998c95622da1e906d32dde6b6651ed5b270b9b5f1Haynes Mathew Georgeint platform_set_snd_device_backend(snd_device_t snd_device, const char * backend); 6098c95622da1e906d32dde6b6651ed5b270b9b5f1Haynes Mathew George 615bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew George/* From platform_info_parser.c */ 625bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew Georgeint platform_info_init(void); 635bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew George 6498c95622da1e906d32dde6b6651ed5b270b9b5f1Haynes Mathew Georgeint platform_get_usecase_index(const char * usecase); 6598c95622da1e906d32dde6b6651ed5b270b9b5f1Haynes Mathew Georgeint platform_set_usecase_pcm_id(audio_usecase_t usecase, int32_t type, int32_t pcm_id); 66cefbbac40220d4e7690d204eecff5f6ae3f63069Eric Laurentvoid platform_set_echo_reference(struct audio_device *adev, bool enable, audio_devices_t out_device); 6798c95622da1e906d32dde6b6651ed5b270b9b5f1Haynes Mathew George 685bc188456348ebdfc5d3c86414952503ec41bd44Haynes Mathew George#endif // AUDIO_PLATFORM_API_H 69