Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. |
| 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 | #ifndef __Q6AFE_H__ |
| 13 | #define __Q6AFE_H__ |
| 14 | #include <sound/apr_audio.h> |
| 15 | |
| 16 | #define MSM_AFE_MONO 0 |
| 17 | #define MSM_AFE_MONO_RIGHT 1 |
| 18 | #define MSM_AFE_MONO_LEFT 2 |
| 19 | #define MSM_AFE_STEREO 3 |
| 20 | |
Neema Shetty | feea774 | 2011-09-11 12:30:36 -0700 | [diff] [blame^] | 21 | #define MSM_AFE_PORT_TYPE_RX 0 |
| 22 | #define MSM_AFE_PORT_TYPE_TX 1 |
| 23 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | enum { |
| 25 | IDX_PRIMARY_I2S_RX = 0, |
| 26 | IDX_PRIMARY_I2S_TX = 1, |
| 27 | IDX_PCM_RX = 2, |
| 28 | IDX_PCM_TX = 3, |
| 29 | IDX_SECONDARY_I2S_RX = 4, |
| 30 | IDX_SECONDARY_I2S_TX = 5, |
| 31 | IDX_MI2S_RX = 6, |
| 32 | IDX_MI2S_TX = 7, |
| 33 | IDX_HDMI_RX = 8, |
| 34 | IDX_RSVD_2 = 9, |
| 35 | IDX_RSVD_3 = 10, |
| 36 | IDX_DIGI_MIC_TX = 11, |
| 37 | IDX_VOICE_RECORD_RX = 12, |
| 38 | IDX_VOICE_RECORD_TX = 13, |
| 39 | IDX_VOICE_PLAYBACK_TX = 14, |
| 40 | IDX_SLIMBUS_0_RX = 15, |
| 41 | IDX_SLIMBUS_0_TX = 16, |
| 42 | IDX_SLIMBUS_1_RX = 17, |
| 43 | IDX_SLIMBUS_1_TX = 18, |
| 44 | IDX_SLIMBUS_2_RX = 19, |
| 45 | IDX_SLIMBUS_2_TX = 20, |
| 46 | IDX_SLIMBUS_3_RX = 21, |
| 47 | IDX_SLIMBUS_3_TX = 22, |
| 48 | IDX_SLIMBUS_4_RX = 23, |
| 49 | IDX_SLIMBUS_4_TX = 24, |
| 50 | IDX_INT_BT_SCO_RX = 25, |
| 51 | IDX_INT_BT_SCO_TX = 26, |
| 52 | IDX_INT_BT_A2DP_RX = 27, |
| 53 | IDX_INT_FM_RX = 28, |
| 54 | IDX_INT_FM_TX = 29, |
| 55 | AFE_MAX_PORTS |
| 56 | }; |
| 57 | |
| 58 | int afe_open(u16 port_id, union afe_port_config *afe_config, int rate); |
| 59 | int afe_close(int port_id); |
| 60 | int afe_loopback(u16 enable, u16 rx_port, u16 tx_port); |
| 61 | int afe_sidetone(u16 tx_port_id, u16 rx_port_id, u16 enable, uint16_t gain); |
| 62 | int afe_loopback_gain(u16 port_id, u16 volume); |
| 63 | int afe_validate_port(u16 port_id); |
| 64 | int afe_get_port_index(u16 port_id); |
| 65 | int afe_start_pseudo_port(u16 port_id); |
| 66 | int afe_stop_pseudo_port(u16 port_id); |
| 67 | int afe_port_start_nowait(u16 port_id, union afe_port_config *afe_config, |
| 68 | u32 rate); |
| 69 | int afe_port_stop_nowait(int port_id); |
Laxminath Kasam | 885f510 | 2011-07-14 10:20:21 +0530 | [diff] [blame] | 70 | int afe_apply_gain(u16 port_id, u16 gain); |
Jay Wang | 6a30543 | 2011-08-05 16:01:54 -0700 | [diff] [blame] | 71 | int afe_q6_interface_prepare(void); |
Neema Shetty | feea774 | 2011-09-11 12:30:36 -0700 | [diff] [blame^] | 72 | int afe_get_port_type(u16 port_id); |
Jay Wang | 6a30543 | 2011-08-05 16:01:54 -0700 | [diff] [blame] | 73 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 74 | #endif /* __Q6AFE_H__ */ |