audio-lnx: Initial change for techpack of audio drivers.
Add snapshot for audio drivers for SDM targets. The code is migrated from msm-4.9 kernel at the below cutoff - (74ff856e8d6: "net: ipc_router: Add dynamic enable/disable wakeup source feature") This changes are done for new techpack addition for audio kernel. Migrate all audio kernel drivers to this techpack. Change-Id: I33d580af3ba86a5cb777583efc5d4cdaf2882d93 Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
This commit is contained in:

committed by
Martin Fick

parent
5ff0cfa736
commit
8e2277f79f
6
include/uapi/Kbuild
Normal file
6
include/uapi/Kbuild
Normal file
@@ -0,0 +1,6 @@
|
||||
# UAPI Header export list
|
||||
# Top-level Makefile calls into asm-$(ARCH)
|
||||
# List only non-arch directories below
|
||||
|
||||
header-y += linux/
|
||||
header-y += sound/
|
19
include/uapi/linux/Kbuild
Normal file
19
include/uapi/linux/Kbuild
Normal file
@@ -0,0 +1,19 @@
|
||||
# UAPI Header export list
|
||||
header-y += avtimer.h
|
||||
header-y += msm_audio.h
|
||||
header-y += msm_audio_aac.h
|
||||
header-y += msm_audio_ac3.h
|
||||
header-y += msm_audio_amrnb.h
|
||||
header-y += msm_audio_amrwb.h
|
||||
header-y += msm_audio_amrwbplus.h
|
||||
header-y += msm_audio_calibration.h
|
||||
header-y += msm_audio_mvs.h
|
||||
header-y += msm_audio_qcp.h
|
||||
header-y += msm_audio_sbc.h
|
||||
header-y += msm_audio_voicememo.h
|
||||
header-y += msm_audio_wma.h
|
||||
header-y += msm_audio_wmapro.h
|
||||
header-y += msm_audio_alac.h
|
||||
header-y += msm_audio_ape.h
|
||||
header-y += msm_audio_g711.h
|
||||
header-y += msm_audio_g711_dec.h
|
10
include/uapi/linux/avtimer.h
Normal file
10
include/uapi/linux/avtimer.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _UAPI_AVTIMER_H
|
||||
#define _UAPI_AVTIMER_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define MAJOR_NUM 100
|
||||
|
||||
#define IOCTL_GET_AVTIMER_TICK _IOR(MAJOR_NUM, 0, uint64_t)
|
||||
|
||||
#endif
|
475
include/uapi/linux/msm_audio.h
Normal file
475
include/uapi/linux/msm_audio.h
Normal file
@@ -0,0 +1,475 @@
|
||||
/* include/linux/msm_audio.h
|
||||
*
|
||||
* Copyright (C) 2008 Google, Inc.
|
||||
* Copyright (c) 2012, 2014, 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UAPI_LINUX_MSM_AUDIO_H
|
||||
#define _UAPI_LINUX_MSM_AUDIO_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/* PCM Audio */
|
||||
|
||||
#define AUDIO_IOCTL_MAGIC 'a'
|
||||
|
||||
#define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned int)
|
||||
#define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned int)
|
||||
#define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned int)
|
||||
#define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, \
|
||||
struct msm_audio_config)
|
||||
#define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, \
|
||||
struct msm_audio_config)
|
||||
#define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, \
|
||||
struct msm_audio_stats)
|
||||
#define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned int)
|
||||
#define AUDIO_SET_ADRC _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned int)
|
||||
#define AUDIO_SET_EQ _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned int)
|
||||
#define AUDIO_SET_RX_IIR _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned int)
|
||||
#define AUDIO_SET_VOLUME _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned int)
|
||||
#define AUDIO_PAUSE _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned int)
|
||||
#define AUDIO_PLAY_DTMF _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned int)
|
||||
#define AUDIO_GET_EVENT _IOR(AUDIO_IOCTL_MAGIC, 13, \
|
||||
struct msm_audio_event)
|
||||
#define AUDIO_ABORT_GET_EVENT _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned int)
|
||||
#define AUDIO_REGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 15, unsigned int)
|
||||
#define AUDIO_DEREGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 16, unsigned int)
|
||||
#define AUDIO_ASYNC_WRITE _IOW(AUDIO_IOCTL_MAGIC, 17, \
|
||||
struct msm_audio_aio_buf)
|
||||
#define AUDIO_ASYNC_READ _IOW(AUDIO_IOCTL_MAGIC, 18, \
|
||||
struct msm_audio_aio_buf)
|
||||
#define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode)
|
||||
#define AUDIO_GET_NUM_SND_DEVICE _IOR(AUDIO_IOCTL_MAGIC, 20, unsigned int)
|
||||
#define AUDIO_GET_SND_DEVICES _IOWR(AUDIO_IOCTL_MAGIC, 21, \
|
||||
struct msm_snd_device_list)
|
||||
#define AUDIO_ENABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 22, unsigned int)
|
||||
#define AUDIO_DISABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 23, unsigned int)
|
||||
#define AUDIO_ROUTE_STREAM _IOW(AUDIO_IOCTL_MAGIC, 24, \
|
||||
struct msm_audio_route_config)
|
||||
#define AUDIO_GET_PCM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 30, unsigned int)
|
||||
#define AUDIO_SET_PCM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 31, unsigned int)
|
||||
#define AUDIO_SWITCH_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 32, unsigned int)
|
||||
#define AUDIO_SET_MUTE _IOW(AUDIO_IOCTL_MAGIC, 33, unsigned int)
|
||||
#define AUDIO_UPDATE_ACDB _IOW(AUDIO_IOCTL_MAGIC, 34, unsigned int)
|
||||
#define AUDIO_START_VOICE _IOW(AUDIO_IOCTL_MAGIC, 35, unsigned int)
|
||||
#define AUDIO_STOP_VOICE _IOW(AUDIO_IOCTL_MAGIC, 36, unsigned int)
|
||||
#define AUDIO_REINIT_ACDB _IOW(AUDIO_IOCTL_MAGIC, 39, unsigned int)
|
||||
#define AUDIO_OUTPORT_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 40, unsigned short)
|
||||
#define AUDIO_SET_ERR_THRESHOLD_VALUE _IOW(AUDIO_IOCTL_MAGIC, 41, \
|
||||
unsigned short)
|
||||
#define AUDIO_GET_BITSTREAM_ERROR_INFO _IOR(AUDIO_IOCTL_MAGIC, 42, \
|
||||
struct msm_audio_bitstream_error_info)
|
||||
|
||||
#define AUDIO_SET_SRS_TRUMEDIA_PARAM _IOW(AUDIO_IOCTL_MAGIC, 43, unsigned int)
|
||||
|
||||
/* Qualcomm technologies inc extensions */
|
||||
#define AUDIO_SET_STREAM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 80, \
|
||||
struct msm_audio_stream_config)
|
||||
#define AUDIO_GET_STREAM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 81, \
|
||||
struct msm_audio_stream_config)
|
||||
#define AUDIO_GET_SESSION_ID _IOR(AUDIO_IOCTL_MAGIC, 82, unsigned short)
|
||||
#define AUDIO_GET_STREAM_INFO _IOR(AUDIO_IOCTL_MAGIC, 83, \
|
||||
struct msm_audio_bitstream_info)
|
||||
#define AUDIO_SET_PAN _IOW(AUDIO_IOCTL_MAGIC, 84, unsigned int)
|
||||
#define AUDIO_SET_QCONCERT_PLUS _IOW(AUDIO_IOCTL_MAGIC, 85, unsigned int)
|
||||
#define AUDIO_SET_MBADRC _IOW(AUDIO_IOCTL_MAGIC, 86, unsigned int)
|
||||
#define AUDIO_SET_VOLUME_PATH _IOW(AUDIO_IOCTL_MAGIC, 87, \
|
||||
struct msm_vol_info)
|
||||
#define AUDIO_SET_MAX_VOL_ALL _IOW(AUDIO_IOCTL_MAGIC, 88, unsigned int)
|
||||
#define AUDIO_ENABLE_AUDPRE _IOW(AUDIO_IOCTL_MAGIC, 89, unsigned int)
|
||||
#define AUDIO_SET_AGC _IOW(AUDIO_IOCTL_MAGIC, 90, unsigned int)
|
||||
#define AUDIO_SET_NS _IOW(AUDIO_IOCTL_MAGIC, 91, unsigned int)
|
||||
#define AUDIO_SET_TX_IIR _IOW(AUDIO_IOCTL_MAGIC, 92, unsigned int)
|
||||
#define AUDIO_GET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 93, \
|
||||
struct msm_audio_buf_cfg)
|
||||
#define AUDIO_SET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 94, \
|
||||
struct msm_audio_buf_cfg)
|
||||
#define AUDIO_SET_ACDB_BLK _IOW(AUDIO_IOCTL_MAGIC, 95, \
|
||||
struct msm_acdb_cmd_device)
|
||||
#define AUDIO_GET_ACDB_BLK _IOW(AUDIO_IOCTL_MAGIC, 96, \
|
||||
struct msm_acdb_cmd_device)
|
||||
|
||||
#define AUDIO_REGISTER_ION _IOW(AUDIO_IOCTL_MAGIC, 97, \
|
||||
struct msm_audio_ion_info)
|
||||
#define AUDIO_DEREGISTER_ION _IOW(AUDIO_IOCTL_MAGIC, 98, \
|
||||
struct msm_audio_ion_info)
|
||||
#define AUDIO_SET_EFFECTS_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 99, \
|
||||
struct msm_hwacc_effects_config)
|
||||
#define AUDIO_EFFECTS_SET_BUF_LEN _IOW(AUDIO_IOCTL_MAGIC, 100, \
|
||||
struct msm_hwacc_buf_cfg)
|
||||
#define AUDIO_EFFECTS_GET_BUF_AVAIL _IOW(AUDIO_IOCTL_MAGIC, 101, \
|
||||
struct msm_hwacc_buf_avail)
|
||||
#define AUDIO_EFFECTS_WRITE _IOW(AUDIO_IOCTL_MAGIC, 102, void *)
|
||||
#define AUDIO_EFFECTS_READ _IOWR(AUDIO_IOCTL_MAGIC, 103, void *)
|
||||
#define AUDIO_EFFECTS_SET_PP_PARAMS _IOW(AUDIO_IOCTL_MAGIC, 104, void *)
|
||||
|
||||
#define AUDIO_PM_AWAKE _IOW(AUDIO_IOCTL_MAGIC, 105, unsigned int)
|
||||
#define AUDIO_PM_RELAX _IOW(AUDIO_IOCTL_MAGIC, 106, unsigned int)
|
||||
|
||||
#define AUDIO_MAX_COMMON_IOCTL_NUM 107
|
||||
|
||||
|
||||
#define HANDSET_MIC 0x01
|
||||
#define HANDSET_SPKR 0x02
|
||||
#define HEADSET_MIC 0x03
|
||||
#define HEADSET_SPKR_MONO 0x04
|
||||
#define HEADSET_SPKR_STEREO 0x05
|
||||
#define SPKR_PHONE_MIC 0x06
|
||||
#define SPKR_PHONE_MONO 0x07
|
||||
#define SPKR_PHONE_STEREO 0x08
|
||||
#define BT_SCO_MIC 0x09
|
||||
#define BT_SCO_SPKR 0x0A
|
||||
#define BT_A2DP_SPKR 0x0B
|
||||
#define TTY_HEADSET_MIC 0x0C
|
||||
#define TTY_HEADSET_SPKR 0x0D
|
||||
|
||||
/* Default devices are not supported in a */
|
||||
/* device switching context. Only supported */
|
||||
/* for stream devices. */
|
||||
/* DO NOT USE */
|
||||
#define DEFAULT_TX 0x0E
|
||||
#define DEFAULT_RX 0x0F
|
||||
|
||||
#define BT_A2DP_TX 0x10
|
||||
|
||||
#define HEADSET_MONO_PLUS_SPKR_MONO_RX 0x11
|
||||
#define HEADSET_MONO_PLUS_SPKR_STEREO_RX 0x12
|
||||
#define HEADSET_STEREO_PLUS_SPKR_MONO_RX 0x13
|
||||
#define HEADSET_STEREO_PLUS_SPKR_STEREO_RX 0x14
|
||||
|
||||
#define I2S_RX 0x20
|
||||
#define I2S_TX 0x21
|
||||
|
||||
#define ADRC_ENABLE 0x0001
|
||||
#define EQUALIZER_ENABLE 0x0002
|
||||
#define IIR_ENABLE 0x0004
|
||||
#define QCONCERT_PLUS_ENABLE 0x0008
|
||||
#define MBADRC_ENABLE 0x0010
|
||||
#define SRS_ENABLE 0x0020
|
||||
#define SRS_DISABLE 0x0040
|
||||
|
||||
#define AGC_ENABLE 0x0001
|
||||
#define NS_ENABLE 0x0002
|
||||
#define TX_IIR_ENABLE 0x0004
|
||||
#define FLUENCE_ENABLE 0x0008
|
||||
|
||||
#define VOC_REC_UPLINK 0x00
|
||||
#define VOC_REC_DOWNLINK 0x01
|
||||
#define VOC_REC_BOTH 0x02
|
||||
|
||||
struct msm_audio_config {
|
||||
uint32_t buffer_size;
|
||||
uint32_t buffer_count;
|
||||
uint32_t channel_count;
|
||||
uint32_t sample_rate;
|
||||
uint32_t type;
|
||||
uint32_t meta_field;
|
||||
uint32_t bits;
|
||||
uint32_t unused[3];
|
||||
};
|
||||
|
||||
struct msm_audio_stream_config {
|
||||
uint32_t buffer_size;
|
||||
uint32_t buffer_count;
|
||||
};
|
||||
|
||||
struct msm_audio_buf_cfg {
|
||||
uint32_t meta_info_enable;
|
||||
uint32_t frames_per_buf;
|
||||
};
|
||||
|
||||
struct msm_audio_stats {
|
||||
uint32_t byte_count;
|
||||
uint32_t sample_count;
|
||||
uint32_t unused[2];
|
||||
};
|
||||
|
||||
struct msm_audio_ion_info {
|
||||
int fd;
|
||||
void *vaddr;
|
||||
};
|
||||
|
||||
struct msm_audio_pmem_info {
|
||||
int fd;
|
||||
void *vaddr;
|
||||
};
|
||||
|
||||
struct msm_audio_aio_buf {
|
||||
void *buf_addr;
|
||||
uint32_t buf_len;
|
||||
uint32_t data_len;
|
||||
void *private_data;
|
||||
unsigned short mfield_sz; /*only useful for data has meta field */
|
||||
};
|
||||
|
||||
/* Audio routing */
|
||||
|
||||
#define SND_IOCTL_MAGIC 's'
|
||||
|
||||
#define SND_MUTE_UNMUTED 0
|
||||
#define SND_MUTE_MUTED 1
|
||||
|
||||
struct msm_mute_info {
|
||||
uint32_t mute;
|
||||
uint32_t path;
|
||||
};
|
||||
|
||||
struct msm_vol_info {
|
||||
uint32_t vol;
|
||||
uint32_t path;
|
||||
};
|
||||
|
||||
struct msm_voicerec_mode {
|
||||
uint32_t rec_mode;
|
||||
};
|
||||
|
||||
struct msm_snd_device_config {
|
||||
uint32_t device;
|
||||
uint32_t ear_mute;
|
||||
uint32_t mic_mute;
|
||||
};
|
||||
|
||||
#define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
|
||||
|
||||
enum cad_device_path_type {
|
||||
CAD_DEVICE_PATH_RX, /*For Decoding session*/
|
||||
CAD_DEVICE_PATH_TX, /* For Encoding session*/
|
||||
CAD_DEVICE_PATH_RX_TX, /* For Voice call */
|
||||
CAD_DEVICE_PATH_LB, /* For loopback (FM Analog)*/
|
||||
CAD_DEVICE_PATH_MAX
|
||||
};
|
||||
|
||||
struct cad_devices_type {
|
||||
uint32_t rx_device;
|
||||
uint32_t tx_device;
|
||||
enum cad_device_path_type pathtype;
|
||||
};
|
||||
|
||||
struct msm_cad_device_config {
|
||||
struct cad_devices_type device;
|
||||
uint32_t ear_mute;
|
||||
uint32_t mic_mute;
|
||||
};
|
||||
|
||||
#define CAD_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_cad_device_config *)
|
||||
|
||||
#define SND_METHOD_VOICE 0
|
||||
#define SND_METHOD_MIDI 4
|
||||
|
||||
struct msm_snd_volume_config {
|
||||
uint32_t device;
|
||||
uint32_t method;
|
||||
uint32_t volume;
|
||||
};
|
||||
|
||||
#define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
|
||||
|
||||
struct msm_cad_volume_config {
|
||||
struct cad_devices_type device;
|
||||
uint32_t method;
|
||||
uint32_t volume;
|
||||
};
|
||||
|
||||
#define CAD_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_cad_volume_config *)
|
||||
|
||||
/* Returns the number of SND endpoints supported. */
|
||||
|
||||
#define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned int *)
|
||||
|
||||
struct msm_snd_endpoint {
|
||||
int id; /* input and output */
|
||||
char name[64]; /* output only */
|
||||
};
|
||||
|
||||
/* Takes an index between 0 and one less than the number returned by
|
||||
* SND_GET_NUM_ENDPOINTS, and returns the SND index and name of a
|
||||
* SND endpoint. On input, the .id field contains the number of the
|
||||
* endpoint, and on exit it contains the SND index, while .name contains
|
||||
* the description of the endpoint.
|
||||
*/
|
||||
|
||||
#define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
|
||||
|
||||
|
||||
#define SND_AVC_CTL _IOW(SND_IOCTL_MAGIC, 6, unsigned int *)
|
||||
#define SND_AGC_CTL _IOW(SND_IOCTL_MAGIC, 7, unsigned int *)
|
||||
|
||||
/*return the number of CAD endpoints supported. */
|
||||
|
||||
#define CAD_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned int *)
|
||||
|
||||
struct msm_cad_endpoint {
|
||||
int id; /* input and output */
|
||||
char name[64]; /* output only */
|
||||
};
|
||||
|
||||
/* Takes an index between 0 and one less than the number returned by
|
||||
* SND_GET_NUM_ENDPOINTS, and returns the CAD index and name of a
|
||||
* CAD endpoint. On input, the .id field contains the number of the
|
||||
* endpoint, and on exit it contains the SND index, while .name contains
|
||||
* the description of the endpoint.
|
||||
*/
|
||||
|
||||
#define CAD_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_cad_endpoint *)
|
||||
|
||||
struct msm_audio_pcm_config {
|
||||
uint32_t pcm_feedback; /* 0 - disable > 0 - enable */
|
||||
uint32_t buffer_count; /* Number of buffers to allocate */
|
||||
uint32_t buffer_size; /* Size of buffer for capturing of
|
||||
* PCM samples
|
||||
*/
|
||||
};
|
||||
|
||||
#define AUDIO_EVENT_SUSPEND 0
|
||||
#define AUDIO_EVENT_RESUME 1
|
||||
#define AUDIO_EVENT_WRITE_DONE 2
|
||||
#define AUDIO_EVENT_READ_DONE 3
|
||||
#define AUDIO_EVENT_STREAM_INFO 4
|
||||
#define AUDIO_EVENT_BITSTREAM_ERROR_INFO 5
|
||||
|
||||
#define AUDIO_CODEC_TYPE_MP3 0
|
||||
#define AUDIO_CODEC_TYPE_AAC 1
|
||||
|
||||
struct msm_audio_bitstream_info {
|
||||
uint32_t codec_type;
|
||||
uint32_t chan_info;
|
||||
uint32_t sample_rate;
|
||||
uint32_t bit_stream_info;
|
||||
uint32_t bit_rate;
|
||||
uint32_t unused[3];
|
||||
};
|
||||
|
||||
struct msm_audio_bitstream_error_info {
|
||||
uint32_t dec_id;
|
||||
uint32_t err_msg_indicator;
|
||||
uint32_t err_type;
|
||||
};
|
||||
|
||||
union msm_audio_event_payload {
|
||||
struct msm_audio_aio_buf aio_buf;
|
||||
struct msm_audio_bitstream_info stream_info;
|
||||
struct msm_audio_bitstream_error_info error_info;
|
||||
int reserved;
|
||||
};
|
||||
|
||||
struct msm_audio_event {
|
||||
int event_type;
|
||||
int timeout_ms;
|
||||
union msm_audio_event_payload event_payload;
|
||||
};
|
||||
|
||||
#define MSM_SNDDEV_CAP_RX 0x1
|
||||
#define MSM_SNDDEV_CAP_TX 0x2
|
||||
#define MSM_SNDDEV_CAP_VOICE 0x4
|
||||
|
||||
struct msm_snd_device_info {
|
||||
uint32_t dev_id;
|
||||
uint32_t dev_cap; /* bitmask describe capability of device */
|
||||
char dev_name[64];
|
||||
};
|
||||
|
||||
struct msm_snd_device_list {
|
||||
uint32_t num_dev; /* Indicate number of device info to be retrieved */
|
||||
struct msm_snd_device_info *list;
|
||||
};
|
||||
|
||||
struct msm_dtmf_config {
|
||||
uint16_t path;
|
||||
uint16_t dtmf_hi;
|
||||
uint16_t dtmf_low;
|
||||
uint16_t duration;
|
||||
uint16_t tx_gain;
|
||||
uint16_t rx_gain;
|
||||
uint16_t mixing;
|
||||
};
|
||||
|
||||
#define AUDIO_ROUTE_STREAM_VOICE_RX 0
|
||||
#define AUDIO_ROUTE_STREAM_VOICE_TX 1
|
||||
#define AUDIO_ROUTE_STREAM_PLAYBACK 2
|
||||
#define AUDIO_ROUTE_STREAM_REC 3
|
||||
|
||||
struct msm_audio_route_config {
|
||||
uint32_t stream_type;
|
||||
uint32_t stream_id;
|
||||
uint32_t dev_id;
|
||||
};
|
||||
|
||||
#define AUDIO_MAX_EQ_BANDS 12
|
||||
|
||||
struct msm_audio_eq_band {
|
||||
uint16_t band_idx; /* The band index, 0 .. 11 */
|
||||
uint32_t filter_type; /* Filter band type */
|
||||
uint32_t center_freq_hz; /* Filter band center frequency */
|
||||
uint32_t filter_gain; /* Filter band initial gain (dB) */
|
||||
/* Range is +12 dB to -12 dB with 1dB increments. */
|
||||
uint32_t q_factor;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct msm_audio_eq_stream_config {
|
||||
uint32_t enable; /* Number of consequtive bands specified */
|
||||
uint32_t num_bands;
|
||||
struct msm_audio_eq_band eq_bands[AUDIO_MAX_EQ_BANDS];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct msm_acdb_cmd_device {
|
||||
uint32_t command_id;
|
||||
uint32_t device_id;
|
||||
uint32_t network_id;
|
||||
uint32_t sample_rate_id; /* Actual sample rate value */
|
||||
uint32_t interface_id; /* See interface id's above */
|
||||
uint32_t algorithm_block_id; /* See enumerations above */
|
||||
uint32_t total_bytes; /* Length in bytes used by buffer */
|
||||
uint32_t *phys_buf; /* Physical Address of data */
|
||||
};
|
||||
|
||||
struct msm_hwacc_data_config {
|
||||
__u32 buf_size;
|
||||
__u32 num_buf;
|
||||
__u32 num_channels;
|
||||
__u8 channel_map[8];
|
||||
__u32 sample_rate;
|
||||
__u32 bits_per_sample;
|
||||
};
|
||||
|
||||
struct msm_hwacc_buf_cfg {
|
||||
__u32 input_len;
|
||||
__u32 output_len;
|
||||
};
|
||||
|
||||
struct msm_hwacc_buf_avail {
|
||||
__u32 input_num_avail;
|
||||
__u32 output_num_avail;
|
||||
};
|
||||
|
||||
struct msm_hwacc_effects_config {
|
||||
struct msm_hwacc_data_config input;
|
||||
struct msm_hwacc_data_config output;
|
||||
struct msm_hwacc_buf_cfg buf_cfg;
|
||||
__u32 meta_mode_enabled;
|
||||
__u32 overwrite_topology;
|
||||
__s32 topology;
|
||||
};
|
||||
|
||||
#define ADSP_STREAM_PP_EVENT 0
|
||||
#define ADSP_STREAM_ENCDEC_EVENT 1
|
||||
#define ADSP_STREAM_IEC_61937_FMT_UPDATE_EVENT 2
|
||||
#define ADSP_STREAM_EVENT_MAX 3
|
||||
|
||||
struct msm_adsp_event_data {
|
||||
__u32 event_type;
|
||||
__u32 payload_len;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
#endif
|
76
include/uapi/linux/msm_audio_aac.h
Normal file
76
include/uapi/linux/msm_audio_aac.h
Normal file
@@ -0,0 +1,76 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_AAC_H
|
||||
#define _UAPI_MSM_AUDIO_AAC_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_SET_AAC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_aac_config)
|
||||
#define AUDIO_GET_AAC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_aac_config)
|
||||
|
||||
#define AUDIO_SET_AAC_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+3), struct msm_audio_aac_enc_config)
|
||||
|
||||
#define AUDIO_GET_AAC_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+4), struct msm_audio_aac_enc_config)
|
||||
|
||||
#define AUDIO_SET_AAC_MIX_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+5), uint32_t)
|
||||
|
||||
#define AUDIO_AAC_FORMAT_ADTS -1
|
||||
#define AUDIO_AAC_FORMAT_RAW 0x0000
|
||||
#define AUDIO_AAC_FORMAT_PSUEDO_RAW 0x0001
|
||||
#define AUDIO_AAC_FORMAT_LOAS 0x0002
|
||||
#define AUDIO_AAC_FORMAT_ADIF 0x0003
|
||||
|
||||
#define AUDIO_AAC_OBJECT_LC 0x0002
|
||||
#define AUDIO_AAC_OBJECT_LTP 0x0004
|
||||
#define AUDIO_AAC_OBJECT_ERLC 0x0011
|
||||
#define AUDIO_AAC_OBJECT_BSAC 0x0016
|
||||
|
||||
#define AUDIO_AAC_SEC_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SEC_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SCA_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SCA_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SPEC_DATA_RES_ON 0x0001
|
||||
#define AUDIO_AAC_SPEC_DATA_RES_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SBR_ON_FLAG_ON 0x0001
|
||||
#define AUDIO_AAC_SBR_ON_FLAG_OFF 0x0000
|
||||
|
||||
#define AUDIO_AAC_SBR_PS_ON_FLAG_ON 0x0001
|
||||
#define AUDIO_AAC_SBR_PS_ON_FLAG_OFF 0x0000
|
||||
|
||||
/* Primary channel on both left and right channels */
|
||||
#define AUDIO_AAC_DUAL_MONO_PL_PR 0
|
||||
/* Secondary channel on both left and right channels */
|
||||
#define AUDIO_AAC_DUAL_MONO_SL_SR 1
|
||||
/* Primary channel on right channel and 2nd on left channel */
|
||||
#define AUDIO_AAC_DUAL_MONO_SL_PR 2
|
||||
/* 2nd channel on right channel and primary on left channel */
|
||||
#define AUDIO_AAC_DUAL_MONO_PL_SR 3
|
||||
|
||||
struct msm_audio_aac_config {
|
||||
signed short format;
|
||||
unsigned short audio_object;
|
||||
unsigned short ep_config; /* 0 ~ 3 useful only obj = ERLC */
|
||||
unsigned short aac_section_data_resilience_flag;
|
||||
unsigned short aac_scalefactor_data_resilience_flag;
|
||||
unsigned short aac_spectral_data_resilience_flag;
|
||||
unsigned short sbr_on_flag;
|
||||
unsigned short sbr_ps_on_flag;
|
||||
unsigned short dual_mono_mode;
|
||||
unsigned short channel_configuration;
|
||||
unsigned short sample_rate;
|
||||
};
|
||||
|
||||
struct msm_audio_aac_enc_config {
|
||||
uint32_t channels;
|
||||
uint32_t sample_rate;
|
||||
uint32_t bit_rate;
|
||||
uint32_t stream_format;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_AAC_H */
|
41
include/uapi/linux/msm_audio_ac3.h
Normal file
41
include/uapi/linux/msm_audio_ac3.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_AC3_H
|
||||
#define _UAPI_MSM_AUDIO_AC3_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_SET_AC3_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned int)
|
||||
#define AUDIO_GET_AC3_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned int)
|
||||
|
||||
#define AUDAC3_DEF_WORDSIZE 0
|
||||
#define AUDAC3_DEF_USER_DOWNMIX_FLAG 0x0
|
||||
#define AUDAC3_DEF_USER_KARAOKE_FLAG 0x0
|
||||
#define AUDAC3_DEF_ERROR_CONCEALMENT 0
|
||||
#define AUDAC3_DEF_MAX_REPEAT_COUNT 0
|
||||
|
||||
struct msm_audio_ac3_config {
|
||||
unsigned short numChans;
|
||||
unsigned short wordSize;
|
||||
unsigned short kCapableMode;
|
||||
unsigned short compMode;
|
||||
unsigned short outLfeOn;
|
||||
unsigned short outputMode;
|
||||
unsigned short stereoMode;
|
||||
unsigned short dualMonoMode;
|
||||
unsigned short fsCod;
|
||||
unsigned short pcmScaleFac;
|
||||
unsigned short dynRngScaleHi;
|
||||
unsigned short dynRngScaleLow;
|
||||
unsigned short user_downmix_flag;
|
||||
unsigned short user_karaoke_flag;
|
||||
unsigned short dm_address_high;
|
||||
unsigned short dm_address_low;
|
||||
unsigned short ko_address_high;
|
||||
unsigned short ko_address_low;
|
||||
unsigned short error_concealment;
|
||||
unsigned short max_rep_count;
|
||||
unsigned short channel_routing_mode[6];
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_AC3_H */
|
24
include/uapi/linux/msm_audio_alac.h
Normal file
24
include/uapi/linux/msm_audio_alac.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_ALAC_H
|
||||
#define _UAPI_MSM_AUDIO_ALAC_H
|
||||
|
||||
#define AUDIO_GET_ALAC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_alac_config)
|
||||
#define AUDIO_SET_ALAC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_alac_config)
|
||||
|
||||
struct msm_audio_alac_config {
|
||||
uint32_t frameLength;
|
||||
uint8_t compatVersion;
|
||||
uint8_t bitDepth;
|
||||
uint8_t pb; /* currently unused */
|
||||
uint8_t mb; /* currently unused */
|
||||
uint8_t kb; /* currently unused */
|
||||
uint8_t channelCount;
|
||||
uint16_t maxRun; /* currently unused */
|
||||
uint32_t maxSize;
|
||||
uint32_t averageBitRate;
|
||||
uint32_t sampleRate;
|
||||
uint32_t channelLayout;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_ALAC_H */
|
34
include/uapi/linux/msm_audio_amrnb.h
Normal file
34
include/uapi/linux/msm_audio_amrnb.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_AMRNB_H
|
||||
#define _UAPI_MSM_AUDIO_AMRNB_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_GET_AMRNB_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned int)
|
||||
#define AUDIO_SET_AMRNB_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned int)
|
||||
#define AUDIO_GET_AMRNB_ENC_CONFIG_V2 _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+2), \
|
||||
struct msm_audio_amrnb_enc_config_v2)
|
||||
#define AUDIO_SET_AMRNB_ENC_CONFIG_V2 _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+3), \
|
||||
struct msm_audio_amrnb_enc_config_v2)
|
||||
|
||||
struct msm_audio_amrnb_enc_config {
|
||||
unsigned short voicememoencweight1;
|
||||
unsigned short voicememoencweight2;
|
||||
unsigned short voicememoencweight3;
|
||||
unsigned short voicememoencweight4;
|
||||
unsigned short dtx_mode_enable; /* 0xFFFF - enable, 0- disable */
|
||||
unsigned short test_mode_enable; /* 0xFFFF - enable, 0- disable */
|
||||
unsigned short enc_mode; /* 0-MR475,1-MR515,2-MR59,3-MR67,4-MR74
|
||||
* 5-MR795, 6- MR102, 7- MR122(default)
|
||||
*/
|
||||
};
|
||||
|
||||
struct msm_audio_amrnb_enc_config_v2 {
|
||||
uint32_t band_mode;
|
||||
uint32_t dtx_enable;
|
||||
uint32_t frame_format;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_AMRNB_H */
|
18
include/uapi/linux/msm_audio_amrwb.h
Normal file
18
include/uapi/linux/msm_audio_amrwb.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_AMRWB_H
|
||||
#define _UAPI_MSM_AUDIO_AMRWB_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_GET_AMRWB_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), \
|
||||
struct msm_audio_amrwb_enc_config)
|
||||
#define AUDIO_SET_AMRWB_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), \
|
||||
struct msm_audio_amrwb_enc_config)
|
||||
|
||||
struct msm_audio_amrwb_enc_config {
|
||||
uint32_t band_mode;
|
||||
uint32_t dtx_enable;
|
||||
uint32_t frame_format;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_AMRWB_H */
|
18
include/uapi/linux/msm_audio_amrwbplus.h
Normal file
18
include/uapi/linux/msm_audio_amrwbplus.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_AMR_WB_PLUS_H
|
||||
#define _UAPI_MSM_AUDIO_AMR_WB_PLUS_H
|
||||
|
||||
#define AUDIO_GET_AMRWBPLUS_CONFIG_V2 _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+2), struct msm_audio_amrwbplus_config_v2)
|
||||
#define AUDIO_SET_AMRWBPLUS_CONFIG_V2 _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+3), struct msm_audio_amrwbplus_config_v2)
|
||||
|
||||
struct msm_audio_amrwbplus_config_v2 {
|
||||
unsigned int size_bytes;
|
||||
unsigned int version;
|
||||
unsigned int num_channels;
|
||||
unsigned int amr_band_mode;
|
||||
unsigned int amr_dtx_mode;
|
||||
unsigned int amr_frame_fmt;
|
||||
unsigned int amr_lsf_idx;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_AMR_WB_PLUS_H */
|
26
include/uapi/linux/msm_audio_ape.h
Normal file
26
include/uapi/linux/msm_audio_ape.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* The following structure has been taken
|
||||
* from Monkey's Audio SDK with permission
|
||||
*/
|
||||
|
||||
#ifndef _UAPI_MSM_AUDIO_APE_H
|
||||
#define _UAPI_MSM_AUDIO_APE_H
|
||||
|
||||
#define AUDIO_GET_APE_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_ape_config)
|
||||
#define AUDIO_SET_APE_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_ape_config)
|
||||
|
||||
struct msm_audio_ape_config {
|
||||
uint16_t compatibleVersion;
|
||||
uint16_t compressionLevel;
|
||||
uint32_t formatFlags;
|
||||
uint32_t blocksPerFrame;
|
||||
uint32_t finalFrameBlocks;
|
||||
uint32_t totalFrames;
|
||||
uint16_t bitsPerSample;
|
||||
uint16_t numChannels;
|
||||
uint32_t sampleRate;
|
||||
uint32_t seekTablePresent;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_APE_H */
|
719
include/uapi/linux/msm_audio_calibration.h
Normal file
719
include/uapi/linux/msm_audio_calibration.h
Normal file
@@ -0,0 +1,719 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_CALIBRATION_H
|
||||
#define _UAPI_MSM_AUDIO_CALIBRATION_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define CAL_IOCTL_MAGIC 'a'
|
||||
|
||||
#define AUDIO_ALLOCATE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
200, void *)
|
||||
#define AUDIO_DEALLOCATE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
201, void *)
|
||||
#define AUDIO_PREPARE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
202, void *)
|
||||
#define AUDIO_SET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
203, void *)
|
||||
#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
204, void *)
|
||||
#define AUDIO_POST_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
205, void *)
|
||||
|
||||
/* For Real-Time Audio Calibration */
|
||||
#define AUDIO_GET_RTAC_ADM_INFO _IOR(CAL_IOCTL_MAGIC, \
|
||||
207, void *)
|
||||
#define AUDIO_GET_RTAC_VOICE_INFO _IOR(CAL_IOCTL_MAGIC, \
|
||||
208, void *)
|
||||
#define AUDIO_GET_RTAC_ADM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
209, void *)
|
||||
#define AUDIO_SET_RTAC_ADM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
210, void *)
|
||||
#define AUDIO_GET_RTAC_ASM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
211, void *)
|
||||
#define AUDIO_SET_RTAC_ASM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
212, void *)
|
||||
#define AUDIO_GET_RTAC_CVS_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
213, void *)
|
||||
#define AUDIO_SET_RTAC_CVS_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
214, void *)
|
||||
#define AUDIO_GET_RTAC_CVP_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
215, void *)
|
||||
#define AUDIO_SET_RTAC_CVP_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
216, void *)
|
||||
#define AUDIO_GET_RTAC_AFE_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
217, void *)
|
||||
#define AUDIO_SET_RTAC_AFE_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
218, void *)
|
||||
enum {
|
||||
CVP_VOC_RX_TOPOLOGY_CAL_TYPE = 0,
|
||||
CVP_VOC_TX_TOPOLOGY_CAL_TYPE,
|
||||
CVP_VOCPROC_STATIC_CAL_TYPE,
|
||||
CVP_VOCPROC_DYNAMIC_CAL_TYPE,
|
||||
CVS_VOCSTRM_STATIC_CAL_TYPE,
|
||||
CVP_VOCDEV_CFG_CAL_TYPE,
|
||||
CVP_VOCPROC_STATIC_COL_CAL_TYPE,
|
||||
CVP_VOCPROC_DYNAMIC_COL_CAL_TYPE,
|
||||
CVS_VOCSTRM_STATIC_COL_CAL_TYPE,
|
||||
|
||||
ADM_TOPOLOGY_CAL_TYPE,
|
||||
ADM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
ADM_AUDPROC_CAL_TYPE,
|
||||
ADM_AUDVOL_CAL_TYPE,
|
||||
|
||||
ASM_TOPOLOGY_CAL_TYPE,
|
||||
ASM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
ASM_AUDSTRM_CAL_TYPE,
|
||||
|
||||
AFE_COMMON_RX_CAL_TYPE,
|
||||
AFE_COMMON_TX_CAL_TYPE,
|
||||
AFE_ANC_CAL_TYPE,
|
||||
AFE_AANC_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_CAL_TYPE,
|
||||
AFE_HW_DELAY_CAL_TYPE,
|
||||
AFE_SIDETONE_CAL_TYPE,
|
||||
AFE_TOPOLOGY_CAL_TYPE,
|
||||
AFE_CUST_TOPOLOGY_CAL_TYPE,
|
||||
|
||||
LSM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
LSM_TOPOLOGY_CAL_TYPE,
|
||||
LSM_CAL_TYPE,
|
||||
|
||||
ADM_RTAC_INFO_CAL_TYPE,
|
||||
VOICE_RTAC_INFO_CAL_TYPE,
|
||||
ADM_RTAC_APR_CAL_TYPE,
|
||||
ASM_RTAC_APR_CAL_TYPE,
|
||||
VOICE_RTAC_APR_CAL_TYPE,
|
||||
|
||||
MAD_CAL_TYPE,
|
||||
ULP_AFE_CAL_TYPE,
|
||||
ULP_LSM_CAL_TYPE,
|
||||
|
||||
DTS_EAGLE_CAL_TYPE,
|
||||
AUDIO_CORE_METAINFO_CAL_TYPE,
|
||||
SRS_TRUMEDIA_CAL_TYPE,
|
||||
|
||||
CORE_CUSTOM_TOPOLOGIES_CAL_TYPE,
|
||||
ADM_RTAC_AUDVOL_CAL_TYPE,
|
||||
|
||||
ULP_LSM_TOPOLOGY_ID_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE,
|
||||
AFE_SIDETONE_IIR_CAL_TYPE,
|
||||
MAX_CAL_TYPES,
|
||||
};
|
||||
|
||||
#define AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE
|
||||
#define AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE
|
||||
|
||||
#define AFE_SIDETONE_IIR_CAL_TYPE AFE_SIDETONE_IIR_CAL_TYPE
|
||||
|
||||
enum {
|
||||
VERSION_0_0,
|
||||
};
|
||||
|
||||
enum {
|
||||
PER_VOCODER_CAL_BIT_MASK = 0x10000,
|
||||
};
|
||||
|
||||
#define MAX_IOCTL_CMD_SIZE 512
|
||||
|
||||
/* common structures */
|
||||
|
||||
struct audio_cal_header {
|
||||
int32_t data_size;
|
||||
int32_t version;
|
||||
int32_t cal_type;
|
||||
int32_t cal_type_size;
|
||||
};
|
||||
|
||||
struct audio_cal_type_header {
|
||||
int32_t version;
|
||||
int32_t buffer_number;
|
||||
};
|
||||
|
||||
struct audio_cal_data {
|
||||
/* Size of cal data at mem_handle allocation or at vaddr */
|
||||
int32_t cal_size;
|
||||
/* If mem_handle if shared memory is used*/
|
||||
int32_t mem_handle;
|
||||
/* size of virtual memory if shared memory not used */
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_ALLOCATE_CALIBRATION */
|
||||
struct audio_cal_type_alloc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_alloc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_alloc cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_DEALLOCATE_CALIBRATION */
|
||||
struct audio_cal_type_dealloc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_dealloc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_dealloc cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_PREPARE_CALIBRATION */
|
||||
struct audio_cal_type_prepare {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_prepare {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_prepare cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_POST_CALIBRATION */
|
||||
struct audio_cal_type_post {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_post {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_post cal_type;
|
||||
};
|
||||
|
||||
/*AUDIO_CORE_META_INFO */
|
||||
|
||||
struct audio_cal_info_metainfo {
|
||||
uint32_t nKey;
|
||||
};
|
||||
|
||||
/* Cal info types */
|
||||
enum {
|
||||
RX_DEVICE,
|
||||
TX_DEVICE,
|
||||
MAX_PATH_TYPE
|
||||
};
|
||||
|
||||
struct audio_cal_info_adm_top {
|
||||
int32_t topology;
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t app_type;
|
||||
int32_t sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audproc {
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t app_type;
|
||||
int32_t sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audvol {
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t app_type;
|
||||
int32_t vol_index;
|
||||
};
|
||||
|
||||
struct audio_cal_info_afe {
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_afe_top {
|
||||
int32_t topology;
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_asm_top {
|
||||
int32_t topology;
|
||||
int32_t app_type;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audstrm {
|
||||
int32_t app_type;
|
||||
};
|
||||
|
||||
struct audio_cal_info_aanc {
|
||||
int32_t acdb_id;
|
||||
};
|
||||
|
||||
#define MAX_HW_DELAY_ENTRIES 25
|
||||
|
||||
struct audio_cal_hw_delay_entry {
|
||||
uint32_t sample_rate;
|
||||
uint32_t delay_usec;
|
||||
};
|
||||
|
||||
struct audio_cal_hw_delay_data {
|
||||
uint32_t num_entries;
|
||||
struct audio_cal_hw_delay_entry entry[MAX_HW_DELAY_ENTRIES];
|
||||
};
|
||||
|
||||
struct audio_cal_info_hw_delay {
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t property_type;
|
||||
struct audio_cal_hw_delay_data data;
|
||||
};
|
||||
|
||||
enum msm_spkr_prot_states {
|
||||
MSM_SPKR_PROT_CALIBRATED,
|
||||
MSM_SPKR_PROT_CALIBRATION_IN_PROGRESS,
|
||||
MSM_SPKR_PROT_DISABLED,
|
||||
MSM_SPKR_PROT_NOT_CALIBRATED,
|
||||
MSM_SPKR_PROT_PRE_CALIBRATED,
|
||||
MSM_SPKR_PROT_IN_FTM_MODE
|
||||
};
|
||||
#define MSM_SPKR_PROT_IN_FTM_MODE MSM_SPKR_PROT_IN_FTM_MODE
|
||||
|
||||
enum msm_spkr_count {
|
||||
SP_V2_SPKR_1,
|
||||
SP_V2_SPKR_2,
|
||||
SP_V2_NUM_MAX_SPKRS
|
||||
};
|
||||
|
||||
struct audio_cal_info_spk_prot_cfg {
|
||||
int32_t r0[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t t0[SP_V2_NUM_MAX_SPKRS];
|
||||
uint32_t quick_calib_flag;
|
||||
uint32_t mode;
|
||||
/*
|
||||
* 0 - Start spk prot
|
||||
* 1 - Start calib
|
||||
* 2 - Disable spk prot
|
||||
*/
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_ftm_cfg {
|
||||
uint32_t wait_time[SP_V2_NUM_MAX_SPKRS];
|
||||
uint32_t ftm_time[SP_V2_NUM_MAX_SPKRS];
|
||||
uint32_t mode;
|
||||
/*
|
||||
* 0 - normal running mode
|
||||
* 1 - Calibration
|
||||
* 2 - FTM mode
|
||||
*/
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_ex_vi_ftm_cfg {
|
||||
uint32_t wait_time[SP_V2_NUM_MAX_SPKRS];
|
||||
uint32_t ftm_time[SP_V2_NUM_MAX_SPKRS];
|
||||
uint32_t mode;
|
||||
/*
|
||||
* 0 - normal running mode
|
||||
* 2 - FTM mode
|
||||
*/
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_ex_vi_param {
|
||||
int32_t freq_q20[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t resis_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t qmct_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_param {
|
||||
int32_t r_dc_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t temp_q22[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_msm_spk_prot_status {
|
||||
int32_t r0[SP_V2_NUM_MAX_SPKRS];
|
||||
int32_t status;
|
||||
};
|
||||
|
||||
struct audio_cal_info_sidetone {
|
||||
uint16_t enable;
|
||||
uint16_t gain;
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
int32_t mid;
|
||||
int32_t pid;
|
||||
};
|
||||
|
||||
#define MAX_SIDETONE_IIR_DATA_SIZE 224
|
||||
#define MAX_NO_IIR_FILTER_STAGE 10
|
||||
|
||||
struct audio_cal_info_sidetone_iir {
|
||||
uint16_t iir_enable;
|
||||
uint16_t num_biquad_stages;
|
||||
uint16_t pregain;
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
int32_t mid;
|
||||
int32_t pid;
|
||||
uint8_t iir_config[MAX_SIDETONE_IIR_DATA_SIZE];
|
||||
};
|
||||
struct audio_cal_info_lsm_top {
|
||||
int32_t topology;
|
||||
int32_t acdb_id;
|
||||
int32_t app_type;
|
||||
};
|
||||
|
||||
|
||||
struct audio_cal_info_lsm {
|
||||
int32_t acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
int32_t path;
|
||||
int32_t app_type;
|
||||
};
|
||||
|
||||
struct audio_cal_info_voc_top {
|
||||
int32_t topology;
|
||||
int32_t acdb_id;
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocproc {
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
int32_t tx_sample_rate;
|
||||
int32_t rx_sample_rate;
|
||||
};
|
||||
|
||||
enum {
|
||||
DEFAULT_FEATURE_SET,
|
||||
VOL_BOOST_FEATURE_SET,
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocvol {
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
/* DEFAULT_ or VOL_BOOST_FEATURE_SET */
|
||||
int32_t feature_set;
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocdev_cfg {
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
};
|
||||
|
||||
#define MAX_VOICE_COLUMNS 20
|
||||
|
||||
union audio_cal_col_na {
|
||||
uint8_t val8;
|
||||
uint16_t val16;
|
||||
uint32_t val32;
|
||||
uint64_t val64;
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_col {
|
||||
uint32_t id;
|
||||
uint32_t type;
|
||||
union audio_cal_col_na na_value;
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_col_data {
|
||||
uint32_t num_columns;
|
||||
struct audio_cal_col column[MAX_VOICE_COLUMNS];
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_info_voc_col {
|
||||
int32_t table_id;
|
||||
int32_t tx_acdb_id;
|
||||
int32_t rx_acdb_id;
|
||||
struct audio_cal_col_data data;
|
||||
};
|
||||
|
||||
/* AUDIO_SET_CALIBRATION & */
|
||||
struct audio_cal_type_basic {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_basic {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_basic cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_adm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_adm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_adm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_adm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_metainfo {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_metainfo cal_info;
|
||||
};
|
||||
|
||||
struct audio_core_metainfo {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_metainfo cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audproc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audproc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audproc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audproc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audvol {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audvol cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audvol {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audvol cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_asm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_asm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_asm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_asm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audstrm {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audstrm cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audstrm {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audstrm cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_afe {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_afe cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_afe {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_afe cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_afe_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_afe_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_afe_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_afe_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_aanc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_aanc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_aanc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_aanc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_fb_spk_prot_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_spk_prot_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_fb_spk_prot_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_fb_spk_prot_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_ftm_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_ftm_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_ftm_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_ftm_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_ex_vi_ftm_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_ex_vi_ftm_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_ex_vi_ftm_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_ex_vi_ftm_cfg cal_type;
|
||||
};
|
||||
struct audio_cal_type_hw_delay {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_hw_delay cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_hw_delay {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_hw_delay cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sidetone {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sidetone cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sidetone {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sidetone cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sidetone_iir {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sidetone_iir cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sidetone_iir {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sidetone_iir cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_lsm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_lsm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_lsm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_lsm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_lsm {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_lsm cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_lsm {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_lsm cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_voc_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_voc_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_voc_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_voc_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocproc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocproc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocproc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocproc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocvol {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocvol cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocvol {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocvol cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocdev_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocdev_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocdev_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocdev_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_voc_col {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_voc_col cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_voc_col {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_voc_col cal_type;
|
||||
};
|
||||
|
||||
/* AUDIO_GET_CALIBRATION */
|
||||
struct audio_cal_type_fb_spk_prot_status {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_msm_spk_prot_status cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_fb_spk_prot_status {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_fb_spk_prot_status cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_param cal_type;
|
||||
};
|
||||
struct audio_cal_type_sp_ex_vi_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_ex_vi_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_ex_vi_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_ex_vi_param cal_type;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_CALIBRATION_H */
|
17
include/uapi/linux/msm_audio_g711.h
Normal file
17
include/uapi/linux/msm_audio_g711.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_G711_H
|
||||
#define _UAPI_MSM_AUDIO_G711_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
struct msm_audio_g711_enc_config {
|
||||
uint32_t sample_rate;
|
||||
};
|
||||
|
||||
#define AUDIO_SET_G711_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_g711_enc_config)
|
||||
|
||||
#define AUDIO_GET_G711_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_g711_enc_config)
|
||||
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_G711_H */
|
16
include/uapi/linux/msm_audio_g711_dec.h
Normal file
16
include/uapi/linux/msm_audio_g711_dec.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_G711_H
|
||||
#define _UAPI_MSM_AUDIO_G711_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
struct msm_audio_g711_dec_config {
|
||||
uint32_t sample_rate;
|
||||
};
|
||||
|
||||
#define AUDIO_SET_G711_DEC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_g711_dec_config)
|
||||
|
||||
#define AUDIO_GET_G711_DEC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_g711_dec_config)
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_G711_H */
|
155
include/uapi/linux/msm_audio_mvs.h
Normal file
155
include/uapi/linux/msm_audio_mvs.h
Normal file
@@ -0,0 +1,155 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_MVS_H
|
||||
#define _UAPI_MSM_AUDIO_MVS_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_GET_MVS_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM + 0), unsigned int)
|
||||
#define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned int)
|
||||
|
||||
/* MVS modes */
|
||||
#define MVS_MODE_IS733 0x1 /*QCELP 13K*/
|
||||
#define MVS_MODE_IS127 0x2 /*EVRC-8k*/
|
||||
#define MVS_MODE_4GV_NB 0x3 /*EVRC-B*/
|
||||
#define MVS_MODE_4GV_WB 0x4 /*EVRC-WB*/
|
||||
#define MVS_MODE_AMR 0x5
|
||||
#define MVS_MODE_EFR 0x6
|
||||
#define MVS_MODE_FR 0x7
|
||||
#define MVS_MODE_HR 0x8
|
||||
#define MVS_MODE_LINEAR_PCM 0x9
|
||||
#define MVS_MODE_G711 0xA
|
||||
#define MVS_MODE_PCM 0xC
|
||||
#define MVS_MODE_AMR_WB 0xD
|
||||
#define MVS_MODE_G729A 0xE
|
||||
#define MVS_MODE_G711A 0xF
|
||||
#define MVS_MODE_G722 0x10
|
||||
#define MVS_MODE_PCM_WB 0x12
|
||||
|
||||
enum msm_audio_amr_mode {
|
||||
MVS_AMR_MODE_0475, /* AMR 4.75 kbps */
|
||||
MVS_AMR_MODE_0515, /* AMR 5.15 kbps */
|
||||
MVS_AMR_MODE_0590, /* AMR 5.90 kbps */
|
||||
MVS_AMR_MODE_0670, /* AMR 6.70 kbps */
|
||||
MVS_AMR_MODE_0740, /* AMR 7.40 kbps */
|
||||
MVS_AMR_MODE_0795, /* AMR 7.95 kbps */
|
||||
MVS_AMR_MODE_1020, /* AMR 10.20 kbps */
|
||||
MVS_AMR_MODE_1220, /* AMR 12.20 kbps */
|
||||
MVS_AMR_MODE_0660, /* AMR-WB 6.60 kbps */
|
||||
MVS_AMR_MODE_0885, /* AMR-WB 8.85 kbps */
|
||||
MVS_AMR_MODE_1265, /* AMR-WB 12.65 kbps */
|
||||
MVS_AMR_MODE_1425, /* AMR-WB 14.25 kbps */
|
||||
MVS_AMR_MODE_1585, /* AMR-WB 15.85 kbps */
|
||||
MVS_AMR_MODE_1825, /* AMR-WB 18.25 kbps */
|
||||
MVS_AMR_MODE_1985, /* AMR-WB 19.85 kbps */
|
||||
MVS_AMR_MODE_2305, /* AMR-WB 23.05 kbps */
|
||||
MVS_AMR_MODE_2385, /* AMR-WB 23.85 kbps */
|
||||
MVS_AMR_MODE_UNDEF
|
||||
};
|
||||
|
||||
/* The MVS VOC rate type is used to identify the rate of QCELP 13K(IS733),
|
||||
* EVRC(IS127), 4GV, or 4GV-WB frame.
|
||||
*/
|
||||
enum msm_audio_voc_rate {
|
||||
MVS_VOC_0_RATE, /* Blank frame */
|
||||
MVS_VOC_8_RATE, /* 1/8 rate */
|
||||
MVS_VOC_4_RATE, /* 1/4 rate */
|
||||
MVS_VOC_2_RATE, /* 1/2 rate */
|
||||
MVS_VOC_1_RATE, /* Full rate */
|
||||
MVS_VOC_ERASURE, /* erasure frame */
|
||||
MVS_VOC_RATE_MAX,
|
||||
MVS_VOC_RATE_UNDEF = MVS_VOC_RATE_MAX
|
||||
};
|
||||
|
||||
enum msm_audio_amr_frame_type {
|
||||
MVS_AMR_SPEECH_GOOD, /* Good speech frame */
|
||||
MVS_AMR_SPEECH_DEGRADED, /* Speech degraded */
|
||||
MVS_AMR_ONSET, /* Onset */
|
||||
MVS_AMR_SPEECH_BAD, /* Corrupt speech frame (bad CRC) */
|
||||
MVS_AMR_SID_FIRST, /* First silence descriptor */
|
||||
MVS_AMR_SID_UPDATE, /* Comfort noise frame */
|
||||
MVS_AMR_SID_BAD, /* Corrupt SID frame (bad CRC) */
|
||||
MVS_AMR_NO_DATA, /* Nothing to transmit */
|
||||
MVS_AMR_SPEECH_LOST /* Downlink speech lost */
|
||||
};
|
||||
|
||||
enum msm_audio_g711a_mode {
|
||||
MVS_G711A_MODE_MULAW,
|
||||
MVS_G711A_MODE_ALAW
|
||||
};
|
||||
|
||||
enum msm_audio_g711_mode {
|
||||
MVS_G711_MODE_MULAW,
|
||||
MVS_G711_MODE_ALAW
|
||||
};
|
||||
|
||||
enum mvs_g722_mode_type {
|
||||
MVS_G722_MODE_01,
|
||||
MVS_G722_MODE_02,
|
||||
MVS_G722_MODE_03,
|
||||
MVS_G722_MODE_MAX,
|
||||
MVS_G722_MODE_UNDEF
|
||||
};
|
||||
|
||||
enum msm_audio_g711a_frame_type {
|
||||
MVS_G711A_SPEECH_GOOD,
|
||||
MVS_G711A_SID,
|
||||
MVS_G711A_NO_DATA,
|
||||
MVS_G711A_ERASURE
|
||||
};
|
||||
|
||||
enum msm_audio_g729a_frame_type {
|
||||
MVS_G729A_NO_DATA,
|
||||
MVS_G729A_SPEECH_GOOD,
|
||||
MVS_G729A_SID,
|
||||
MVS_G729A_ERASURE
|
||||
};
|
||||
|
||||
struct min_max_rate {
|
||||
uint32_t min_rate;
|
||||
uint32_t max_rate;
|
||||
};
|
||||
|
||||
struct msm_audio_mvs_config {
|
||||
uint32_t mvs_mode;
|
||||
uint32_t rate_type;
|
||||
struct min_max_rate min_max_rate;
|
||||
uint32_t dtx_mode;
|
||||
};
|
||||
|
||||
#define MVS_MAX_VOC_PKT_SIZE 640
|
||||
|
||||
struct gsm_header {
|
||||
uint8_t bfi;
|
||||
uint8_t sid;
|
||||
uint8_t taf;
|
||||
uint8_t ufi;
|
||||
};
|
||||
|
||||
struct q6_msm_audio_mvs_frame {
|
||||
union {
|
||||
uint32_t frame_type;
|
||||
uint32_t packet_rate;
|
||||
struct gsm_header gsm_frame_type;
|
||||
} header;
|
||||
uint32_t len;
|
||||
uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE];
|
||||
|
||||
};
|
||||
|
||||
struct msm_audio_mvs_frame {
|
||||
uint32_t frame_type;
|
||||
uint32_t len;
|
||||
uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE];
|
||||
|
||||
};
|
||||
|
||||
#define Q5V2_MVS_MAX_VOC_PKT_SIZE 320
|
||||
|
||||
struct q5v2_msm_audio_mvs_frame {
|
||||
uint32_t frame_type;
|
||||
uint32_t len;
|
||||
uint8_t voc_pkt[Q5V2_MVS_MAX_VOC_PKT_SIZE];
|
||||
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_MVS_H */
|
37
include/uapi/linux/msm_audio_qcp.h
Normal file
37
include/uapi/linux/msm_audio_qcp.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_QCP_H
|
||||
#define _UAPI_MSM_AUDIO_QCP_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_SET_QCELP_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
0, struct msm_audio_qcelp_enc_config)
|
||||
|
||||
#define AUDIO_GET_QCELP_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
1, struct msm_audio_qcelp_enc_config)
|
||||
|
||||
#define AUDIO_SET_EVRC_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
2, struct msm_audio_evrc_enc_config)
|
||||
|
||||
#define AUDIO_GET_EVRC_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
3, struct msm_audio_evrc_enc_config)
|
||||
|
||||
#define CDMA_RATE_BLANK 0x00
|
||||
#define CDMA_RATE_EIGHTH 0x01
|
||||
#define CDMA_RATE_QUARTER 0x02
|
||||
#define CDMA_RATE_HALF 0x03
|
||||
#define CDMA_RATE_FULL 0x04
|
||||
#define CDMA_RATE_ERASURE 0x05
|
||||
|
||||
struct msm_audio_qcelp_enc_config {
|
||||
uint32_t cdma_rate;
|
||||
uint32_t min_bit_rate;
|
||||
uint32_t max_bit_rate;
|
||||
};
|
||||
|
||||
struct msm_audio_evrc_enc_config {
|
||||
uint32_t cdma_rate;
|
||||
uint32_t min_bit_rate;
|
||||
uint32_t max_bit_rate;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_QCP_H */
|
36
include/uapi/linux/msm_audio_sbc.h
Normal file
36
include/uapi/linux/msm_audio_sbc.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_SBC_H
|
||||
#define _UAPI_MSM_AUDIO_SBC_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_SET_SBC_ENC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_sbc_enc_config)
|
||||
|
||||
#define AUDIO_GET_SBC_ENC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_sbc_enc_config)
|
||||
|
||||
#define AUDIO_SBC_BA_LOUDNESS 0x0
|
||||
#define AUDIO_SBC_BA_SNR 0x1
|
||||
|
||||
#define AUDIO_SBC_MODE_MONO 0x0
|
||||
#define AUDIO_SBC_MODE_DUAL 0x1
|
||||
#define AUDIO_SBC_MODE_STEREO 0x2
|
||||
#define AUDIO_SBC_MODE_JSTEREO 0x3
|
||||
|
||||
#define AUDIO_SBC_BANDS_8 0x1
|
||||
|
||||
#define AUDIO_SBC_BLOCKS_4 0x0
|
||||
#define AUDIO_SBC_BLOCKS_8 0x1
|
||||
#define AUDIO_SBC_BLOCKS_12 0x2
|
||||
#define AUDIO_SBC_BLOCKS_16 0x3
|
||||
|
||||
struct msm_audio_sbc_enc_config {
|
||||
uint32_t channels;
|
||||
uint32_t sample_rate;
|
||||
uint32_t bit_allocation;
|
||||
uint32_t number_of_subbands;
|
||||
uint32_t number_of_blocks;
|
||||
uint32_t bit_rate;
|
||||
uint32_t mode;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_SBC_H */
|
66
include/uapi/linux/msm_audio_voicememo.h
Normal file
66
include/uapi/linux/msm_audio_voicememo.h
Normal file
@@ -0,0 +1,66 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_VOICEMEMO_H
|
||||
#define _UAPI_MSM_AUDIO_VOICEMEMO_H
|
||||
|
||||
#include <linux/msm_audio.h>
|
||||
|
||||
#define AUDIO_GET_VOICEMEMO_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned int)
|
||||
#define AUDIO_SET_VOICEMEMO_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned int)
|
||||
|
||||
/* rec_type */
|
||||
enum rpc_voc_rec_dir_type {
|
||||
RPC_VOC_REC_NONE,
|
||||
RPC_VOC_REC_FORWARD,
|
||||
RPC_VOC_REC_REVERSE,
|
||||
RPC_VOC_REC_BOTH,
|
||||
RPC_VOC_MAX_REC_TYPE
|
||||
};
|
||||
|
||||
/* capability */
|
||||
enum rpc_voc_capability_type {
|
||||
RPC_VOC_CAP_IS733 = 4,
|
||||
RPC_VOC_CAP_IS127 = 8,
|
||||
RPC_VOC_CAP_AMR = 64,
|
||||
RPC_VOC_CAP_32BIT_DUMMY = 2147483647
|
||||
};
|
||||
|
||||
/* Rate */
|
||||
enum rpc_voc_rate_type {
|
||||
RPC_VOC_0_RATE = 0,
|
||||
RPC_VOC_8_RATE,
|
||||
RPC_VOC_4_RATE,
|
||||
RPC_VOC_2_RATE,
|
||||
RPC_VOC_1_RATE,
|
||||
RPC_VOC_ERASURE,
|
||||
RPC_VOC_ERR_RATE,
|
||||
RPC_VOC_AMR_RATE_475 = 0,
|
||||
RPC_VOC_AMR_RATE_515 = 1,
|
||||
RPC_VOC_AMR_RATE_590 = 2,
|
||||
RPC_VOC_AMR_RATE_670 = 3,
|
||||
RPC_VOC_AMR_RATE_740 = 4,
|
||||
RPC_VOC_AMR_RATE_795 = 5,
|
||||
RPC_VOC_AMR_RATE_1020 = 6,
|
||||
RPC_VOC_AMR_RATE_1220 = 7,
|
||||
};
|
||||
|
||||
/* frame_format */
|
||||
enum rpc_voc_pb_len_rate_var_type {
|
||||
RPC_VOC_PB_NATIVE_QCP = 3,
|
||||
RPC_VOC_PB_AMR,
|
||||
RPC_VOC_PB_EVB
|
||||
};
|
||||
|
||||
struct msm_audio_voicememo_config {
|
||||
uint32_t rec_type;
|
||||
uint32_t rec_interval_ms;
|
||||
uint32_t auto_stop_ms;
|
||||
uint32_t capability;
|
||||
uint32_t max_rate;
|
||||
uint32_t min_rate;
|
||||
uint32_t frame_format;
|
||||
uint32_t dtx_enable;
|
||||
uint32_t data_req_ms;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_VOICEMEMO_H */
|
33
include/uapi/linux/msm_audio_wma.h
Normal file
33
include/uapi/linux/msm_audio_wma.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_WMA_H
|
||||
#define _UAPI_MSM_AUDIO_WMA_H
|
||||
|
||||
#define AUDIO_GET_WMA_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned int)
|
||||
#define AUDIO_SET_WMA_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned int)
|
||||
|
||||
#define AUDIO_GET_WMA_CONFIG_V2 _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+2), struct msm_audio_wma_config_v2)
|
||||
#define AUDIO_SET_WMA_CONFIG_V2 _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+3), struct msm_audio_wma_config_v2)
|
||||
|
||||
struct msm_audio_wma_config {
|
||||
unsigned short armdatareqthr;
|
||||
unsigned short channelsdecoded;
|
||||
unsigned short wmabytespersec;
|
||||
unsigned short wmasamplingfreq;
|
||||
unsigned short wmaencoderopts;
|
||||
};
|
||||
|
||||
struct msm_audio_wma_config_v2 {
|
||||
unsigned short format_tag;
|
||||
unsigned short numchannels;
|
||||
uint32_t samplingrate;
|
||||
uint32_t avgbytespersecond;
|
||||
unsigned short block_align;
|
||||
unsigned short validbitspersample;
|
||||
uint32_t channelmask;
|
||||
unsigned short encodeopt;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_WMA_H */
|
22
include/uapi/linux/msm_audio_wmapro.h
Normal file
22
include/uapi/linux/msm_audio_wmapro.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _UAPI_MSM_AUDIO_WMAPRO_H
|
||||
#define _UAPI_MSM_AUDIO_WMAPRO_H
|
||||
|
||||
#define AUDIO_GET_WMAPRO_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+0), struct msm_audio_wmapro_config)
|
||||
#define AUDIO_SET_WMAPRO_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
|
||||
(AUDIO_MAX_COMMON_IOCTL_NUM+1), struct msm_audio_wmapro_config)
|
||||
|
||||
struct msm_audio_wmapro_config {
|
||||
unsigned short armdatareqthr;
|
||||
uint8_t validbitspersample;
|
||||
uint8_t numchannels;
|
||||
unsigned short formattag;
|
||||
uint32_t samplingrate;
|
||||
uint32_t avgbytespersecond;
|
||||
unsigned short asfpacketlength;
|
||||
uint32_t channelmask;
|
||||
unsigned short encodeopt;
|
||||
unsigned short advancedencodeopt;
|
||||
uint32_t advancedencodeopt2;
|
||||
};
|
||||
#endif /* _UAPI_MSM_AUDIO_WMAPRO_H */
|
8
include/uapi/sound/Kbuild
Normal file
8
include/uapi/sound/Kbuild
Normal file
@@ -0,0 +1,8 @@
|
||||
# UAPI Header export list
|
||||
header-y += lsm_params.h
|
||||
header-y += audio_slimslave.h
|
||||
header-y += audio_effects.h
|
||||
header-y += devdep_params.h
|
||||
header-y += msmcal-hwdep.h
|
||||
header-y += wcd-dsp-glink.h
|
||||
header-y += voice_params.h
|
361
include/uapi/sound/audio_effects.h
Normal file
361
include/uapi/sound/audio_effects.h
Normal file
@@ -0,0 +1,361 @@
|
||||
#ifndef _AUDIO_EFFECTS_H
|
||||
#define _AUDIO_EFFECTS_H
|
||||
|
||||
/** AUDIO EFFECTS **/
|
||||
|
||||
|
||||
/* CONFIG GET/SET */
|
||||
#define CONFIG_CACHE 0
|
||||
#define CONFIG_SET 1
|
||||
#define CONFIG_GET 2
|
||||
|
||||
/* CONFIG HEADER */
|
||||
/*
|
||||
* MODULE_ID,
|
||||
* DEVICE,
|
||||
* NUM_COMMANDS,
|
||||
* COMMAND_ID_1,
|
||||
* CONFIG_CACHE/SET/GET,
|
||||
* OFFSET_1,
|
||||
* LENGTH_1,
|
||||
* VALUES_1,
|
||||
* ...,
|
||||
* ...,
|
||||
* COMMAND_ID_2,
|
||||
* CONFIG_CACHE/SET/GET,
|
||||
* OFFSET_2,
|
||||
* LENGTH_2,
|
||||
* VALUES_2,
|
||||
* ...,
|
||||
* ...,
|
||||
* COMMAND_ID_3,
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
/* CONFIG PARAM IDs */
|
||||
#define VIRTUALIZER_MODULE 0x00001000
|
||||
#define VIRTUALIZER_ENABLE 0x00001001
|
||||
#define VIRTUALIZER_STRENGTH 0x00001002
|
||||
#define VIRTUALIZER_OUT_TYPE 0x00001003
|
||||
#define VIRTUALIZER_GAIN_ADJUST 0x00001004
|
||||
#define VIRTUALIZER_ENABLE_PARAM_LEN 1
|
||||
#define VIRTUALIZER_STRENGTH_PARAM_LEN 1
|
||||
#define VIRTUALIZER_OUT_TYPE_PARAM_LEN 1
|
||||
#define VIRTUALIZER_GAIN_ADJUST_PARAM_LEN 1
|
||||
|
||||
#define REVERB_MODULE 0x00002000
|
||||
#define REVERB_ENABLE 0x00002001
|
||||
#define REVERB_MODE 0x00002002
|
||||
#define REVERB_PRESET 0x00002003
|
||||
#define REVERB_WET_MIX 0x00002004
|
||||
#define REVERB_GAIN_ADJUST 0x00002005
|
||||
#define REVERB_ROOM_LEVEL 0x00002006
|
||||
#define REVERB_ROOM_HF_LEVEL 0x00002007
|
||||
#define REVERB_DECAY_TIME 0x00002008
|
||||
#define REVERB_DECAY_HF_RATIO 0x00002009
|
||||
#define REVERB_REFLECTIONS_LEVEL 0x0000200a
|
||||
#define REVERB_REFLECTIONS_DELAY 0x0000200b
|
||||
#define REVERB_LEVEL 0x0000200c
|
||||
#define REVERB_DELAY 0x0000200d
|
||||
#define REVERB_DIFFUSION 0x0000200e
|
||||
#define REVERB_DENSITY 0x0000200f
|
||||
#define REVERB_ENABLE_PARAM_LEN 1
|
||||
#define REVERB_MODE_PARAM_LEN 1
|
||||
#define REVERB_PRESET_PARAM_LEN 1
|
||||
#define REVERB_WET_MIX_PARAM_LEN 1
|
||||
#define REVERB_GAIN_ADJUST_PARAM_LEN 1
|
||||
#define REVERB_ROOM_LEVEL_PARAM_LEN 1
|
||||
#define REVERB_ROOM_HF_LEVEL_PARAM_LEN 1
|
||||
#define REVERB_DECAY_TIME_PARAM_LEN 1
|
||||
#define REVERB_DECAY_HF_RATIO_PARAM_LEN 1
|
||||
#define REVERB_REFLECTIONS_LEVEL_PARAM_LEN 1
|
||||
#define REVERB_REFLECTIONS_DELAY_PARAM_LEN 1
|
||||
#define REVERB_LEVEL_PARAM_LEN 1
|
||||
#define REVERB_DELAY_PARAM_LEN 1
|
||||
#define REVERB_DIFFUSION_PARAM_LEN 1
|
||||
#define REVERB_DENSITY_PARAM_LEN 1
|
||||
|
||||
#define BASS_BOOST_MODULE 0x00003000
|
||||
#define BASS_BOOST_ENABLE 0x00003001
|
||||
#define BASS_BOOST_MODE 0x00003002
|
||||
#define BASS_BOOST_STRENGTH 0x00003003
|
||||
#define BASS_BOOST_ENABLE_PARAM_LEN 1
|
||||
#define BASS_BOOST_MODE_PARAM_LEN 1
|
||||
#define BASS_BOOST_STRENGTH_PARAM_LEN 1
|
||||
|
||||
#define EQ_MODULE 0x00004000
|
||||
#define EQ_ENABLE 0x00004001
|
||||
#define EQ_CONFIG 0x00004002
|
||||
#define EQ_NUM_BANDS 0x00004003
|
||||
#define EQ_BAND_LEVELS 0x00004004
|
||||
#define EQ_BAND_LEVEL_RANGE 0x00004005
|
||||
#define EQ_BAND_FREQS 0x00004006
|
||||
#define EQ_SINGLE_BAND_FREQ_RANGE 0x00004007
|
||||
#define EQ_SINGLE_BAND_FREQ 0x00004008
|
||||
#define EQ_BAND_INDEX 0x00004009
|
||||
#define EQ_PRESET_ID 0x0000400a
|
||||
#define EQ_NUM_PRESETS 0x0000400b
|
||||
#define EQ_PRESET_NAME 0x0000400c
|
||||
#define EQ_ENABLE_PARAM_LEN 1
|
||||
#define EQ_CONFIG_PARAM_LEN 3
|
||||
#define EQ_CONFIG_PER_BAND_PARAM_LEN 5
|
||||
#define EQ_NUM_BANDS_PARAM_LEN 1
|
||||
#define EQ_BAND_LEVELS_PARAM_LEN 13
|
||||
#define EQ_BAND_LEVEL_RANGE_PARAM_LEN 2
|
||||
#define EQ_BAND_FREQS_PARAM_LEN 13
|
||||
#define EQ_SINGLE_BAND_FREQ_RANGE_PARAM_LEN 2
|
||||
#define EQ_SINGLE_BAND_FREQ_PARAM_LEN 1
|
||||
#define EQ_BAND_INDEX_PARAM_LEN 1
|
||||
#define EQ_PRESET_ID_PARAM_LEN 1
|
||||
#define EQ_NUM_PRESETS_PARAM_LEN 1
|
||||
#define EQ_PRESET_NAME_PARAM_LEN 32
|
||||
|
||||
#define EQ_TYPE_NONE 0
|
||||
#define EQ_BASS_BOOST 1
|
||||
#define EQ_BASS_CUT 2
|
||||
#define EQ_TREBLE_BOOST 3
|
||||
#define EQ_TREBLE_CUT 4
|
||||
#define EQ_BAND_BOOST 5
|
||||
#define EQ_BAND_CUT 6
|
||||
|
||||
#define SOFT_VOLUME_MODULE 0x00006000
|
||||
#define SOFT_VOLUME_ENABLE 0x00006001
|
||||
#define SOFT_VOLUME_GAIN_2CH 0x00006002
|
||||
#define SOFT_VOLUME_GAIN_MASTER 0x00006003
|
||||
#define SOFT_VOLUME_ENABLE_PARAM_LEN 1
|
||||
#define SOFT_VOLUME_GAIN_2CH_PARAM_LEN 2
|
||||
#define SOFT_VOLUME_GAIN_MASTER_PARAM_LEN 1
|
||||
|
||||
#define SOFT_VOLUME2_MODULE 0x00007000
|
||||
#define SOFT_VOLUME2_ENABLE 0x00007001
|
||||
#define SOFT_VOLUME2_GAIN_2CH 0x00007002
|
||||
#define SOFT_VOLUME2_GAIN_MASTER 0x00007003
|
||||
#define SOFT_VOLUME2_ENABLE_PARAM_LEN SOFT_VOLUME_ENABLE_PARAM_LEN
|
||||
#define SOFT_VOLUME2_GAIN_2CH_PARAM_LEN SOFT_VOLUME_GAIN_2CH_PARAM_LEN
|
||||
#define SOFT_VOLUME2_GAIN_MASTER_PARAM_LEN \
|
||||
SOFT_VOLUME_GAIN_MASTER_PARAM_LEN
|
||||
|
||||
#define PBE_CONF_MODULE_ID 0x00010C2A
|
||||
#define PBE_CONF_PARAM_ID 0x00010C49
|
||||
|
||||
#define PBE_MODULE 0x00008000
|
||||
#define PBE_ENABLE 0x00008001
|
||||
#define PBE_CONFIG 0x00008002
|
||||
#define PBE_ENABLE_PARAM_LEN 1
|
||||
#define PBE_CONFIG_PARAM_LEN 28
|
||||
|
||||
#define COMMAND_PAYLOAD_LEN 3
|
||||
#define COMMAND_PAYLOAD_SZ (COMMAND_PAYLOAD_LEN * sizeof(uint32_t))
|
||||
#define MAX_INBAND_PARAM_SZ 4096
|
||||
#define Q27_UNITY (1 << 27)
|
||||
#define Q8_UNITY (1 << 8)
|
||||
#define CUSTOM_OPENSL_PRESET 18
|
||||
|
||||
#define VIRTUALIZER_ENABLE_PARAM_SZ \
|
||||
(VIRTUALIZER_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define VIRTUALIZER_STRENGTH_PARAM_SZ \
|
||||
(VIRTUALIZER_STRENGTH_PARAM_LEN*sizeof(uint32_t))
|
||||
#define VIRTUALIZER_OUT_TYPE_PARAM_SZ \
|
||||
(VIRTUALIZER_OUT_TYPE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define VIRTUALIZER_GAIN_ADJUST_PARAM_SZ \
|
||||
(VIRTUALIZER_GAIN_ADJUST_PARAM_LEN*sizeof(uint32_t))
|
||||
struct virtualizer_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
uint32_t strength;
|
||||
uint32_t out_type;
|
||||
int32_t gain_adjust;
|
||||
};
|
||||
|
||||
#define NUM_OSL_REVERB_PRESETS_SUPPORTED 6
|
||||
#define REVERB_ENABLE_PARAM_SZ \
|
||||
(REVERB_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_MODE_PARAM_SZ \
|
||||
(REVERB_MODE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_PRESET_PARAM_SZ \
|
||||
(REVERB_PRESET_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_WET_MIX_PARAM_SZ \
|
||||
(REVERB_WET_MIX_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_GAIN_ADJUST_PARAM_SZ \
|
||||
(REVERB_GAIN_ADJUST_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_ROOM_LEVEL_PARAM_SZ \
|
||||
(REVERB_ROOM_LEVEL_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_ROOM_HF_LEVEL_PARAM_SZ \
|
||||
(REVERB_ROOM_HF_LEVEL_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_DECAY_TIME_PARAM_SZ \
|
||||
(REVERB_DECAY_TIME_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_DECAY_HF_RATIO_PARAM_SZ \
|
||||
(REVERB_DECAY_HF_RATIO_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_REFLECTIONS_LEVEL_PARAM_SZ \
|
||||
(REVERB_REFLECTIONS_LEVEL_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_REFLECTIONS_DELAY_PARAM_SZ \
|
||||
(REVERB_REFLECTIONS_DELAY_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_LEVEL_PARAM_SZ \
|
||||
(REVERB_LEVEL_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_DELAY_PARAM_SZ \
|
||||
(REVERB_DELAY_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_DIFFUSION_PARAM_SZ \
|
||||
(REVERB_DIFFUSION_PARAM_LEN*sizeof(uint32_t))
|
||||
#define REVERB_DENSITY_PARAM_SZ \
|
||||
(REVERB_DENSITY_PARAM_LEN*sizeof(uint32_t))
|
||||
struct reverb_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
uint32_t mode;
|
||||
uint32_t preset;
|
||||
uint32_t wet_mix;
|
||||
int32_t gain_adjust;
|
||||
int32_t room_level;
|
||||
int32_t room_hf_level;
|
||||
uint32_t decay_time;
|
||||
uint32_t decay_hf_ratio;
|
||||
int32_t reflections_level;
|
||||
uint32_t reflections_delay;
|
||||
int32_t level;
|
||||
uint32_t delay;
|
||||
uint32_t diffusion;
|
||||
uint32_t density;
|
||||
};
|
||||
|
||||
#define BASS_BOOST_ENABLE_PARAM_SZ \
|
||||
(BASS_BOOST_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define BASS_BOOST_MODE_PARAM_SZ \
|
||||
(BASS_BOOST_MODE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define BASS_BOOST_STRENGTH_PARAM_SZ \
|
||||
(BASS_BOOST_STRENGTH_PARAM_LEN*sizeof(uint32_t))
|
||||
struct bass_boost_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
uint32_t mode;
|
||||
uint32_t strength;
|
||||
};
|
||||
|
||||
|
||||
#define MAX_EQ_BANDS 12
|
||||
#define MAX_OSL_EQ_BANDS 5
|
||||
#define EQ_ENABLE_PARAM_SZ \
|
||||
(EQ_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_CONFIG_PARAM_SZ \
|
||||
(EQ_CONFIG_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_CONFIG_PER_BAND_PARAM_SZ \
|
||||
(EQ_CONFIG_PER_BAND_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_CONFIG_PARAM_MAX_LEN (EQ_CONFIG_PARAM_LEN+\
|
||||
MAX_EQ_BANDS*EQ_CONFIG_PER_BAND_PARAM_LEN)
|
||||
#define EQ_CONFIG_PARAM_MAX_SZ \
|
||||
(EQ_CONFIG_PARAM_MAX_LEN*sizeof(uint32_t))
|
||||
#define EQ_NUM_BANDS_PARAM_SZ \
|
||||
(EQ_NUM_BANDS_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_BAND_LEVELS_PARAM_SZ \
|
||||
(EQ_BAND_LEVELS_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_BAND_LEVEL_RANGE_PARAM_SZ \
|
||||
(EQ_BAND_LEVEL_RANGE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_BAND_FREQS_PARAM_SZ \
|
||||
(EQ_BAND_FREQS_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_SINGLE_BAND_FREQ_RANGE_PARAM_SZ \
|
||||
(EQ_SINGLE_BAND_FREQ_RANGE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_SINGLE_BAND_FREQ_PARAM_SZ \
|
||||
(EQ_SINGLE_BAND_FREQ_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_BAND_INDEX_PARAM_SZ \
|
||||
(EQ_BAND_INDEX_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_PRESET_ID_PARAM_SZ \
|
||||
(EQ_PRESET_ID_PARAM_LEN*sizeof(uint32_t))
|
||||
#define EQ_NUM_PRESETS_PARAM_SZ \
|
||||
(EQ_NUM_PRESETS_PARAM_LEN*sizeof(uint8_t))
|
||||
struct eq_config_t {
|
||||
int32_t eq_pregain;
|
||||
int32_t preset_id;
|
||||
uint32_t num_bands;
|
||||
};
|
||||
struct eq_per_band_config_t {
|
||||
int32_t band_idx;
|
||||
uint32_t filter_type;
|
||||
uint32_t freq_millihertz;
|
||||
int32_t gain_millibels;
|
||||
uint32_t quality_factor;
|
||||
};
|
||||
struct eq_per_band_freq_range_t {
|
||||
uint32_t band_index;
|
||||
uint32_t min_freq_millihertz;
|
||||
uint32_t max_freq_millihertz;
|
||||
};
|
||||
|
||||
struct eq_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
struct eq_config_t config;
|
||||
struct eq_per_band_config_t per_band_cfg[MAX_EQ_BANDS];
|
||||
struct eq_per_band_freq_range_t per_band_freq_range[MAX_EQ_BANDS];
|
||||
uint32_t band_index;
|
||||
uint32_t freq_millihertz;
|
||||
};
|
||||
|
||||
#define PBE_ENABLE_PARAM_SZ \
|
||||
(PBE_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define PBE_CONFIG_PARAM_SZ \
|
||||
(PBE_CONFIG_PARAM_LEN*sizeof(uint16_t))
|
||||
struct pbe_config_t {
|
||||
int16_t real_bass_mix;
|
||||
int16_t bass_color_control;
|
||||
uint16_t main_chain_delay;
|
||||
uint16_t xover_filter_order;
|
||||
uint16_t bandpass_filter_order;
|
||||
int16_t drc_delay;
|
||||
uint16_t rms_tav;
|
||||
int16_t exp_threshold;
|
||||
uint16_t exp_slope;
|
||||
int16_t comp_threshold;
|
||||
uint16_t comp_slope;
|
||||
uint16_t makeup_gain;
|
||||
uint32_t comp_attack;
|
||||
uint32_t comp_release;
|
||||
uint32_t exp_attack;
|
||||
uint32_t exp_release;
|
||||
int16_t limiter_bass_threshold;
|
||||
int16_t limiter_high_threshold;
|
||||
int16_t limiter_bass_makeup_gain;
|
||||
int16_t limiter_high_makeup_gain;
|
||||
int16_t limiter_bass_gc;
|
||||
int16_t limiter_high_gc;
|
||||
int16_t limiter_delay;
|
||||
uint16_t reserved;
|
||||
/* place holder for filter coeffs to be followed */
|
||||
int32_t p1LowPassCoeffs[5*2];
|
||||
int32_t p1HighPassCoeffs[5*2];
|
||||
int32_t p1BandPassCoeffs[5*3];
|
||||
int32_t p1BassShelfCoeffs[5];
|
||||
int32_t p1TrebleShelfCoeffs[5];
|
||||
} __packed;
|
||||
|
||||
struct pbe_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
uint32_t cfg_len;
|
||||
struct pbe_config_t config;
|
||||
};
|
||||
|
||||
#define SOFT_VOLUME_ENABLE_PARAM_SZ \
|
||||
(SOFT_VOLUME_ENABLE_PARAM_LEN*sizeof(uint32_t))
|
||||
#define SOFT_VOLUME_GAIN_MASTER_PARAM_SZ \
|
||||
(SOFT_VOLUME_GAIN_MASTER_PARAM_LEN*sizeof(uint32_t))
|
||||
#define SOFT_VOLUME_GAIN_2CH_PARAM_SZ \
|
||||
(SOFT_VOLUME_GAIN_2CH_PARAM_LEN*sizeof(uint16_t))
|
||||
struct soft_volume_params {
|
||||
uint32_t device;
|
||||
uint32_t enable_flag;
|
||||
uint32_t master_gain;
|
||||
uint32_t left_gain;
|
||||
uint32_t right_gain;
|
||||
};
|
||||
|
||||
struct msm_nt_eff_all_config {
|
||||
struct bass_boost_params bass_boost;
|
||||
struct pbe_params pbe;
|
||||
struct virtualizer_params virtualizer;
|
||||
struct reverb_params reverb;
|
||||
struct eq_params equalizer;
|
||||
struct soft_volume_params saplus_vol;
|
||||
struct soft_volume_params topo_switch_vol;
|
||||
};
|
||||
|
||||
#endif /*_MSM_AUDIO_EFFECTS_H*/
|
18
include/uapi/sound/audio_slimslave.h
Normal file
18
include/uapi/sound/audio_slimslave.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef __AUDIO_SLIMSLAVE_H__
|
||||
#define __AUDIO_SLIMSLAVE_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define AUDIO_SLIMSLAVE_IOCTL_NAME "audio_slimslave"
|
||||
#define AUDIO_SLIMSLAVE_MAGIC 'S'
|
||||
|
||||
#define AUDIO_SLIMSLAVE_IOCTL_UNVOTE _IO(AUDIO_SLIMSLAVE_MAGIC, 0x00)
|
||||
#define AUDIO_SLIMSLAVE_IOCTL_VOTE _IO(AUDIO_SLIMSLAVE_MAGIC, 0x01)
|
||||
|
||||
enum {
|
||||
AUDIO_SLIMSLAVE_UNVOTE,
|
||||
AUDIO_SLIMSLAVE_VOTE
|
||||
};
|
||||
|
||||
#endif
|
56
include/uapi/sound/devdep_params.h
Normal file
56
include/uapi/sound/devdep_params.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _DEV_DEP_H
|
||||
#define _DEV_DEP_H
|
||||
|
||||
struct dolby_param_data {
|
||||
int32_t version;
|
||||
int32_t device_id;
|
||||
int32_t be_id;
|
||||
int32_t param_id;
|
||||
int32_t length;
|
||||
int32_t __user *data;
|
||||
};
|
||||
|
||||
struct dolby_param_license {
|
||||
int32_t dmid;
|
||||
int32_t license_key;
|
||||
};
|
||||
|
||||
#define SNDRV_DEVDEP_DAP_IOCTL_SET_PARAM\
|
||||
_IOWR('U', 0x10, struct dolby_param_data)
|
||||
#define SNDRV_DEVDEP_DAP_IOCTL_GET_PARAM\
|
||||
_IOR('U', 0x11, struct dolby_param_data)
|
||||
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_COMMAND\
|
||||
_IOWR('U', 0x13, struct dolby_param_data)
|
||||
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE\
|
||||
_IOWR('U', 0x14, struct dolby_param_license)
|
||||
#define SNDRV_DEVDEP_DAP_IOCTL_GET_VISUALIZER\
|
||||
_IOR('U', 0x15, struct dolby_param_data)
|
||||
|
||||
#define DTS_EAGLE_MODULE 0x00005000
|
||||
#define DTS_EAGLE_MODULE_ENABLE 0x00005001
|
||||
#define EAGLE_DRIVER_ID 0xF2
|
||||
#define DTS_EAGLE_IOCTL_GET_CACHE_SIZE _IOR(EAGLE_DRIVER_ID, 0, int)
|
||||
#define DTS_EAGLE_IOCTL_SET_CACHE_SIZE _IOW(EAGLE_DRIVER_ID, 1, int)
|
||||
#define DTS_EAGLE_IOCTL_GET_PARAM _IOR(EAGLE_DRIVER_ID, 2, void*)
|
||||
#define DTS_EAGLE_IOCTL_SET_PARAM _IOW(EAGLE_DRIVER_ID, 3, void*)
|
||||
#define DTS_EAGLE_IOCTL_SET_CACHE_BLOCK _IOW(EAGLE_DRIVER_ID, 4, void*)
|
||||
#define DTS_EAGLE_IOCTL_SET_ACTIVE_DEVICE _IOW(EAGLE_DRIVER_ID, 5, void*)
|
||||
#define DTS_EAGLE_IOCTL_GET_LICENSE _IOR(EAGLE_DRIVER_ID, 6, void*)
|
||||
#define DTS_EAGLE_IOCTL_SET_LICENSE _IOW(EAGLE_DRIVER_ID, 7, void*)
|
||||
#define DTS_EAGLE_IOCTL_SEND_LICENSE _IOW(EAGLE_DRIVER_ID, 8, int)
|
||||
#define DTS_EAGLE_IOCTL_SET_VOLUME_COMMANDS _IOW(EAGLE_DRIVER_ID, 9, void*)
|
||||
#define DTS_EAGLE_FLAG_IOCTL_PRE (1<<30)
|
||||
#define DTS_EAGLE_FLAG_IOCTL_JUSTSETCACHE (1<<31)
|
||||
#define DTS_EAGLE_FLAG_IOCTL_GETFROMCORE DTS_EAGLE_FLAG_IOCTL_JUSTSETCACHE
|
||||
#define DTS_EAGLE_FLAG_IOCTL_MASK (~(DTS_EAGLE_FLAG_IOCTL_PRE | \
|
||||
DTS_EAGLE_FLAG_IOCTL_JUSTSETCACHE))
|
||||
#define DTS_EAGLE_FLAG_ALSA_GET (1<<31)
|
||||
|
||||
struct dts_eagle_param_desc {
|
||||
uint32_t id;
|
||||
uint32_t size;
|
||||
int32_t offset;
|
||||
uint32_t device;
|
||||
} __packed;
|
||||
|
||||
#endif
|
200
include/uapi/sound/lsm_params.h
Normal file
200
include/uapi/sound/lsm_params.h
Normal file
@@ -0,0 +1,200 @@
|
||||
#ifndef _UAPI_LSM_PARAMS_H__
|
||||
#define _UAPI_LSM_PARAMS_H__
|
||||
|
||||
#define LSM_POLLING_ENABLE_SUPPORT
|
||||
#define LSM_EVENT_TIMESTAMP_MODE_SUPPORT
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <sound/asound.h>
|
||||
|
||||
#define SNDRV_LSM_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)
|
||||
|
||||
#define LSM_OUT_FORMAT_PCM (0)
|
||||
#define LSM_OUT_FORMAT_ADPCM (1 << 0)
|
||||
|
||||
#define LSM_OUT_DATA_RAW (0)
|
||||
#define LSM_OUT_DATA_PACKED (1)
|
||||
|
||||
#define LSM_OUT_DATA_EVENTS_DISABLED (0)
|
||||
#define LSM_OUT_DATA_EVENTS_ENABLED (1)
|
||||
|
||||
#define LSM_OUT_TRANSFER_MODE_RT (0)
|
||||
#define LSM_OUT_TRANSFER_MODE_FTRT (1)
|
||||
|
||||
#define LSM_ENDPOINT_DETECT_THRESHOLD (0)
|
||||
#define LSM_OPERATION_MODE (1)
|
||||
#define LSM_GAIN (2)
|
||||
#define LSM_MIN_CONFIDENCE_LEVELS (3)
|
||||
#define LSM_REG_SND_MODEL (4)
|
||||
#define LSM_DEREG_SND_MODEL (5)
|
||||
#define LSM_CUSTOM_PARAMS (6)
|
||||
#define LSM_POLLING_ENABLE (7)
|
||||
#define LSM_PARAMS_MAX (LSM_POLLING_ENABLE + 1)
|
||||
|
||||
#define LSM_EVENT_NON_TIME_STAMP_MODE (0)
|
||||
#define LSM_EVENT_TIME_STAMP_MODE (1)
|
||||
|
||||
enum lsm_app_id {
|
||||
LSM_VOICE_WAKEUP_APP_ID = 1,
|
||||
LSM_VOICE_WAKEUP_APP_ID_V2 = 2,
|
||||
};
|
||||
|
||||
enum lsm_detection_mode {
|
||||
LSM_MODE_KEYWORD_ONLY_DETECTION = 1,
|
||||
LSM_MODE_USER_KEYWORD_DETECTION
|
||||
};
|
||||
|
||||
enum lsm_vw_status {
|
||||
LSM_VOICE_WAKEUP_STATUS_RUNNING = 1,
|
||||
LSM_VOICE_WAKEUP_STATUS_DETECTED,
|
||||
LSM_VOICE_WAKEUP_STATUS_END_SPEECH,
|
||||
LSM_VOICE_WAKEUP_STATUS_REJECTED
|
||||
};
|
||||
|
||||
/*
|
||||
* Data for LSM_ENDPOINT_DETECT_THRESHOLD param_type
|
||||
* @epd_begin: Begin threshold
|
||||
* @epd_end: End threshold
|
||||
*/
|
||||
struct snd_lsm_ep_det_thres {
|
||||
__u32 epd_begin;
|
||||
__u32 epd_end;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data for LSM_OPERATION_MODE param_type
|
||||
* @mode: The detection mode to be used
|
||||
* @detect_failure: Setting to enable failure detections.
|
||||
*/
|
||||
struct snd_lsm_detect_mode {
|
||||
enum lsm_detection_mode mode;
|
||||
bool detect_failure;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data for LSM_GAIN param_type
|
||||
* @gain: The gain to be applied on LSM
|
||||
*/
|
||||
struct snd_lsm_gain {
|
||||
__u16 gain;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data for LSM_POLLING_ENABLE param_type
|
||||
* @poll_en: Polling enable or disable
|
||||
*/
|
||||
struct snd_lsm_poll_enable {
|
||||
bool poll_en;
|
||||
};
|
||||
|
||||
|
||||
struct snd_lsm_sound_model_v2 {
|
||||
__u8 __user *data;
|
||||
__u8 *confidence_level;
|
||||
__u32 data_size;
|
||||
enum lsm_detection_mode detection_mode;
|
||||
__u8 num_confidence_levels;
|
||||
bool detect_failure;
|
||||
};
|
||||
|
||||
struct snd_lsm_session_data {
|
||||
enum lsm_app_id app_id;
|
||||
};
|
||||
|
||||
struct snd_lsm_event_status {
|
||||
__u16 status;
|
||||
__u16 payload_size;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
struct snd_lsm_event_status_v3 {
|
||||
__u32 timestamp_lsw;
|
||||
__u32 timestamp_msw;
|
||||
__u16 status;
|
||||
__u16 payload_size;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
struct snd_lsm_detection_params {
|
||||
__u8 *conf_level;
|
||||
enum lsm_detection_mode detect_mode;
|
||||
__u8 num_confidence_levels;
|
||||
bool detect_failure;
|
||||
bool poll_enable;
|
||||
};
|
||||
|
||||
/*
|
||||
* Param info for each parameter type
|
||||
* @module_id: Module to which parameter is to be set
|
||||
* @param_id: Parameter that is to be set
|
||||
* @param_size: size (in number of bytes) for the data
|
||||
* in param_data.
|
||||
* For confidence levels, this is num_conf_levels
|
||||
* For REG_SND_MODEL, this is size of sound model
|
||||
* For CUSTOM_PARAMS, this is size of the entire blob of data
|
||||
* @param_data: Data for the parameter.
|
||||
* For some param_types this is a structure defined, ex: LSM_GAIN
|
||||
* For CONFIDENCE_LEVELS, this is array of confidence levels
|
||||
* For REG_SND_MODEL, this is the sound model data
|
||||
* For CUSTOM_PARAMS, this is the blob of custom data.
|
||||
*/
|
||||
struct lsm_params_info {
|
||||
__u32 module_id;
|
||||
__u32 param_id;
|
||||
__u32 param_size;
|
||||
__u8 __user *param_data;
|
||||
uint32_t param_type;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data passed to the SET_PARAM_V2 IOCTL
|
||||
* @num_params: Number of params that are to be set
|
||||
* should not be greater than LSM_PARAMS_MAX
|
||||
* @params: Points to an array of lsm_params_info
|
||||
* Each entry points to one parameter to set
|
||||
* @data_size: size (in bytes) for params
|
||||
* should be equal to
|
||||
* num_params * sizeof(struct lsm_parms_info)
|
||||
*/
|
||||
struct snd_lsm_module_params {
|
||||
__u8 __user *params;
|
||||
__u32 num_params;
|
||||
__u32 data_size;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data passed to LSM_OUT_FORMAT_CFG IOCTL
|
||||
* @format: The media format enum
|
||||
* @packing: indicates the packing method used for data path
|
||||
* @events: indicates whether data path events need to be enabled
|
||||
* @transfer_mode: indicates whether FTRT mode or RT mode.
|
||||
*/
|
||||
struct snd_lsm_output_format_cfg {
|
||||
__u8 format;
|
||||
__u8 packing;
|
||||
__u8 events;
|
||||
__u8 mode;
|
||||
};
|
||||
|
||||
#define SNDRV_LSM_DEREG_SND_MODEL _IOW('U', 0x01, int)
|
||||
#define SNDRV_LSM_EVENT_STATUS _IOW('U', 0x02, struct snd_lsm_event_status)
|
||||
#define SNDRV_LSM_ABORT_EVENT _IOW('U', 0x03, int)
|
||||
#define SNDRV_LSM_START _IOW('U', 0x04, int)
|
||||
#define SNDRV_LSM_STOP _IOW('U', 0x05, int)
|
||||
#define SNDRV_LSM_SET_SESSION_DATA _IOW('U', 0x06, struct snd_lsm_session_data)
|
||||
#define SNDRV_LSM_REG_SND_MODEL_V2 _IOW('U', 0x07,\
|
||||
struct snd_lsm_sound_model_v2)
|
||||
#define SNDRV_LSM_LAB_CONTROL _IOW('U', 0x08, uint32_t)
|
||||
#define SNDRV_LSM_STOP_LAB _IO('U', 0x09)
|
||||
#define SNDRV_LSM_SET_PARAMS _IOW('U', 0x0A, \
|
||||
struct snd_lsm_detection_params)
|
||||
#define SNDRV_LSM_SET_MODULE_PARAMS _IOW('U', 0x0B, \
|
||||
struct snd_lsm_module_params)
|
||||
#define SNDRV_LSM_OUT_FORMAT_CFG _IOW('U', 0x0C, \
|
||||
struct snd_lsm_output_format_cfg)
|
||||
#define SNDRV_LSM_SET_PORT _IO('U', 0x0D)
|
||||
#define SNDRV_LSM_SET_FWK_MODE_CONFIG _IOW('U', 0x0E, uint32_t)
|
||||
#define SNDRV_LSM_EVENT_STATUS_V3 _IOW('U', 0x0F, \
|
||||
struct snd_lsm_event_status_v3)
|
||||
|
||||
#endif
|
23
include/uapi/sound/msmcal-hwdep.h
Normal file
23
include/uapi/sound/msmcal-hwdep.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _CALIB_HWDEP_H
|
||||
#define _CALIB_HWDEP_H
|
||||
|
||||
#define WCD9XXX_CODEC_HWDEP_NODE 1000
|
||||
enum wcd_cal_type {
|
||||
WCD9XXX_MIN_CAL,
|
||||
WCD9XXX_ANC_CAL = WCD9XXX_MIN_CAL,
|
||||
WCD9XXX_MAD_CAL,
|
||||
WCD9XXX_MBHC_CAL,
|
||||
WCD9XXX_VBAT_CAL,
|
||||
WCD9XXX_MAX_CAL,
|
||||
};
|
||||
|
||||
struct wcdcal_ioctl_buffer {
|
||||
__u32 size;
|
||||
__u8 __user *buffer;
|
||||
enum wcd_cal_type cal_type;
|
||||
};
|
||||
|
||||
#define SNDRV_CTL_IOCTL_HWDEP_CAL_TYPE \
|
||||
_IOW('U', 0x1, struct wcdcal_ioctl_buffer)
|
||||
|
||||
#endif /*_CALIB_HWDEP_H*/
|
14
include/uapi/sound/voice_params.h
Normal file
14
include/uapi/sound/voice_params.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __VOICE_PARAMS_H__
|
||||
#define __VOICE_PARAMS_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <sound/asound.h>
|
||||
|
||||
enum voice_lch_mode {
|
||||
VOICE_LCH_START = 1,
|
||||
VOICE_LCH_STOP
|
||||
};
|
||||
|
||||
#define SNDRV_VOICE_IOCTL_LCH _IOW('U', 0x00, enum voice_lch_mode)
|
||||
|
||||
#endif
|
60
include/uapi/sound/wcd-dsp-glink.h
Normal file
60
include/uapi/sound/wcd-dsp-glink.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef _WCD_DSP_GLINK_H
|
||||
#define _WCD_DSP_GLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define WDSP_CH_NAME_MAX_LEN 50
|
||||
|
||||
enum {
|
||||
WDSP_REG_PKT = 1,
|
||||
WDSP_CMD_PKT,
|
||||
WDSP_READY_PKT,
|
||||
};
|
||||
#define WDSP_READY_PKT WDSP_READY_PKT
|
||||
|
||||
/*
|
||||
* struct wdsp_reg_pkt - Glink channel information structure format
|
||||
* @no_of_channels: Number of glink channels to open
|
||||
* @payload[0]: Dynamic array contains all the glink channels information
|
||||
*/
|
||||
struct wdsp_reg_pkt {
|
||||
__u8 no_of_channels;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* struct wdsp_cmd_pkt - WDSP command packet format
|
||||
* @ch_name: Name of the glink channel
|
||||
* @payload_size: Size of the payload
|
||||
* @payload[0]: Actual data payload
|
||||
*/
|
||||
struct wdsp_cmd_pkt {
|
||||
char ch_name[WDSP_CH_NAME_MAX_LEN];
|
||||
__u32 payload_size;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* struct wdsp_write_pkt - Format that userspace send the data to driver.
|
||||
* @pkt_type: Type of the packet(REG or CMD PKT)
|
||||
* @payload[0]: Payload is either cmd or reg pkt structure based on pkt type
|
||||
*/
|
||||
struct wdsp_write_pkt {
|
||||
__u8 pkt_type;
|
||||
__u8 payload[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* struct wdsp_glink_ch_cfg - Defines the glink channel configuration.
|
||||
* @ch_name: Name of the glink channel
|
||||
* @latency_in_us: Latency specified in micro seconds for QOS
|
||||
* @no_of_intents: Number of intents prequeued
|
||||
* @intents_size[0]: Dynamic array to specify size of each intent
|
||||
*/
|
||||
struct wdsp_glink_ch_cfg {
|
||||
char name[WDSP_CH_NAME_MAX_LEN];
|
||||
__u32 latency_in_us;
|
||||
__u32 no_of_intents;
|
||||
__u32 intents_size[0];
|
||||
};
|
||||
#endif /* _WCD_DSP_GLINK_H */
|
Reference in New Issue
Block a user