summaryrefslogtreecommitdiff
path: root/include/lpe_ctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lpe_ctl.h')
-rw-r--r--include/lpe_ctl.h209
1 files changed, 209 insertions, 0 deletions
diff --git a/include/lpe_ctl.h b/include/lpe_ctl.h
new file mode 100644
index 0000000..edfd00b
--- /dev/null
+++ b/include/lpe_ctl.h
@@ -0,0 +1,209 @@
+/*
+* sound-plugin-hal-clovertrail
+*
+* Copyright (C) 2013 Intel Corporation. All rights reserved.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+#ifndef __LPE_CTRL_H__
+#define __LPE_CTRL_H__
+
+#include <linux/types.h>
+
+#define ENABLE 0x01
+#define DISABLE 0x00
+#define DIFFERENT 0x01
+#define SAME 0x00
+#define SET 0x00
+#define GET 0x01
+#define DONT_CHANGE_MOD_STATE 0x02
+
+#define STREAM_HS 1
+#define STREAM_IHF 2
+#define STREAM_VIBRA1 3
+#define STREAM_VIBRA2 4
+#define STREAM_CAP 5
+
+#define VMIC_HS_LEFT_CHANL 0x00
+#define VMIC_HS_RIGHT_CHANL 0x01
+#define VMIC_IHF_LEFT_CHANL 0x02
+#define VMIC_IHF_RIGHT_CHANL 0x03
+#define VMIC_VIBRA1_CHANL 0x04
+#define VMIC_VIBRA2_CHANL 0x05
+#define VMIC_DISABLED 0x06
+
+/* Device Types used in LPE*/
+typedef enum lpe_dev_types {
+ LPE_DEV_DECODE,
+ LPE_DEV_HS,
+ LPE_DEV_EP,
+ LPE_DEV_IHF,
+ LPE_DEV_VIBRA1,
+ LPE_DEV_VIBRA2,
+ LPE_DEV_MIC1,
+ LPE_DEV_MIC2,
+ LPE_DEV_MIC3,
+ LPE_DEV_MIC4,
+ LPE_MAX_DEV
+} lpe_dev_types_t;
+
+/* LPE Algorithm module IDs*/
+typedef enum lpe_algo_types {
+ LPE_ALGO_TYPE_VOL_CTRL = 0x67,
+ LPE_ALGO_TYPE_MUTE_CTRL = 0x68,
+ LPE_ALGO_TYPE_SIDE_TONE = 0x6A,
+ LPE_ALGO_TYPE_DC_REMOVEL = 0x6B,
+ LPE_ALGO_TYPE_STEREO_EQ = 0x6C,
+ LPE_ALGO_TYPE_SPKR_PROT = 0x6D,
+ LPE_ALGO_TYPE_AV_REMOVAL = 0x70,
+ LPE_ALGO_TYPE_MONO_EQ = 0x71,
+ LPE_ALGO_TYPE_SDRC = 0x72
+}lpe_algo_types_t;
+
+/* Stereo Equalizer module parameters type*/
+typedef enum lpe_param_types_stereo_equalizer {
+ ALGO_PARAM_SEQ_DIFF_SAME_2_CHAN = 0x101,
+ ALGO_PARAM_SEQ_LEFT_CHANNEL_CONF,
+ ALGO_PARAM_SEQ_FIR_COEF_LEFT,
+ ALGO_PARAM_SEQ_IIR_COEF_LEFT,
+ ALGO_PARAM_SEQ_RIGHT_CHANNEL_CONF,
+ ALGO_PARAM_SEQ_FIR_COEF_RIGHT,
+ ALGO_PARAM_SEQ_IIR_COEF_RIGHT
+}lpe_param_types_stereo_equalizer_t;
+
+/* Mono Equalizer module parameters type*/
+typedef enum lpe_param_types_mono_equalizer {
+ ALGO_PARAM_MEQ_CHANNEL_CONF = 0x151,
+ ALGO_PARAM_MEQ_FIR_COEF,
+ ALGO_PARAM_MEQ_IIR_COEF
+}lpe_param_types_mono_equalizer_t;
+
+/* Sidetone module parameters type*/
+typedef enum lpe_param_types_sidetone {
+ ALGO_PARAM_STP_DL_MONO_STEREO_SEL = 0x201,
+ ALGO_PARAM_STP_FIR_ENABLE_DISABLE,
+ ALGO_PARAM_STP_AGC_ENABLE_DISABLE,
+ ALGO_PARAM_STP_FIR_COEF_SIZE,
+ ALGO_PARAM_STP_FIR_COEF,
+ ALGO_PARAM_STP_ADAPTIVE_GAIN,
+ ALGO_PARAM_STP_GAIN
+}lpe_param_types_sidetone_t;
+
+/* DC Removal module parameters type*/
+typedef enum lpe_param_types_dcr {
+ ALGO_PARAM_DCR_IIR_ENABLE_DISABLE = 0x301,
+ ALGO_PARAM_DCR_IIR_COEF,
+}lpe_param_types_dcr_t;
+
+/* Xprot module parameters type*/
+typedef enum lpe_param_types_xprot {
+ ALGO_PARAM_XPORT_PCM_TYPE = 0x401,
+ ALGO_PARAM_XPORT_SFREQ,
+ ALGO_PARAM_XPORT_CHANL_MODE,
+ ALGO_PARAM_XPORT_DISP_LIMIT,
+ ALGO_PARAM_XPORT_TEMP_LIMIT,
+ ALGO_PARAM_XPORT_AMBIENT_TEMP,
+ ALGO_PARAM_XPORT_VOL_LEVEL,
+ ALGO_PARAM_XPORT_FRAME_LENGTH,
+ ALGO_PARAM_XPORT_CONFIG_PARAMS
+}lpe_param_types_xprot_t;
+
+/* Remove Click module parameters type*/
+typedef enum lpe_param_types_RMC {
+ ALGO_PARAM_RMC_PCM_TYPE = 0x501,
+ ALGO_PARAM_RMC_SFREQ,
+ ALGO_PARAM_RMC_EMRGNCY_MODE,
+ ALGO_PARAM_RMC_FRAME_LENGTH,
+ ALGO_PARAM_RMC_CONFIG_PARAMS,
+ ALGO_PARAM_RMC_CHAN_NUM
+}lpe_param_types_RMC_t;
+
+/* volume control module parameters type */
+typedef enum lpe_param_types_vol_ctrl {
+ ALGO_PARAM_VOL_CTRL_STEREO_MONO = 0x601,
+ ALGO_PARAM_VOL_CTRL_GAIN = 0x602
+}lpe_param_types_vol_ctrl_t;
+
+/* mute control module parameters type */
+typedef enum lpe_param_types_mute_ctrl {
+ ALGO_PARAM_MUTE_STEREO_MONO = 0x701,
+ ALGO_PARAM_MUTE_ENABLE_DISABLE = 0x702,
+ ALGO_PARAM_HALF_MUTE_ENABLE_DISABLE = 0x703,
+}lpe_param_types_mute_ctrl_t;
+
+/* SDRC control module parameters type */
+typedef enum lpe_param_types_sdrc_ctrl {
+ ALGO_PARAM_SDRC_NB_BANDS = 0x801,
+ ALGO_PARAM_SDRC_L_A,
+ ALGO_PARAM_SDRC_L_B,
+ ALGO_PARAM_SDRC_L_U,
+ ALGO_PARAM_SDRC_GCOMP_B,
+ ALGO_PARAM_SDRC_SLOPE_LOWERMOST,
+ ALGO_PARAM_SDRC_SLOPE_AB,
+ ALGO_PARAM_SDRC_SLOPE_UPPERMOST,
+ ALGO_PARAM_SDRC_LOUDNESS_ATTACK_TIME,
+ ALGO_PARAM_SDRC_LOUDNESS_RELEASE_TIME,
+ ALGO_PARAM_SDRC_GAIN_ATTACK_TIME,
+ ALGO_PARAM_SDRC_GAIN_RELEASE_TIME
+}lpe_param_types_sdrc_ctrl_t;
+
+typedef enum fw_param_type{
+ LOW_LATENCY=0,
+ NON_LOW_LATENCY,
+ VMIC_CONFIG,
+ DMA_INPUT_BUFFER,
+ DMA_OUTPUT_BUFFER,
+}fw_param_type_t;
+
+typedef struct snd_sst_tuning_params {
+ __u8 type;
+ __u8 str_id;
+ __u8 size;
+ __u8 rsvd;
+ __u64 addr;
+} __attribute__ ((packed)) snd_sst_tuning_params_t;
+
+
+/* Pre and post processing params structure */
+typedef struct snd_ppp_params {
+ __u8 algo_id;/* Post/Pre processing algorithm ID */
+ __u8 str_id; /*Only 5 bits used 0 - 31 are valid*/
+ __u8 enable; /* 0= disable, 1= enable*/
+ __u8 reserved;
+ __u32 size; /*Size of parameters for all blocks*/
+ void *params;
+} __attribute__ ((packed)) snd_ppp_params_t;
+
+/* Parameters block of a module */
+typedef struct ipc_ia_params_block {
+ __u32 type; /*Type of the parameter*/
+ __u32 size; /*size of the parameters in the block*/
+ __u8 params[0]; /*Parameters of the algorithm*/
+}__attribute__ ((packed)) ipc_ia_params_block_t;
+
+/*DSP Ioctls on /dev/intel_sst_ctrl only*/
+#define SNDRV_SST_SET_ALGO _IOW('L', 0x30, struct snd_ppp_params *)
+#define SNDRV_SST_GET_ALGO _IOWR('L', 0x31, struct snd_ppp_params *)
+#define SNDRV_SST_TUNING_PARAMS _IOW('L', 0x32, struct snd_sst_tuning_params *)
+#define SNDRV_SST_SET_RUNTIME_PARAMS _IOW('L', 0x40, struct snd_sst_tuning_params *)
+
+/* Function Declarations */
+int lpe_get_parameter(int str_id, int algo_id, int param_id, int param_length);
+int lpe_set_parameter(int str_id, int algo_id, int param_id, int param_length, char *param_data);
+int change_algo_state(int algo_id, int str_id, int state);
+int check_algo_state(int algo_id, int str_id);
+int lpe_setup_clv();
+#endif /* __LPE_CTRL_H__ */
+