Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.
Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
diff --git a/dsp/q6voice.c b/dsp/q6voice.c
index 983e0a2..985e959 100644
--- a/dsp/q6voice.c
+++ b/dsp/q6voice.c
@@ -292,6 +292,14 @@
return session_name;
}
+/**
+ * voc_get_session_id -
+ * Get session ID of given voice session name
+ *
+ * @name: voice session name
+ *
+ * Returns session id for valid session or 0 if invalid.
+ */
uint32_t voc_get_session_id(char *name)
{
u32 session_id = 0;
@@ -326,6 +334,7 @@
return session_id;
}
+EXPORT_SYMBOL(voc_get_session_id);
static struct voice_data *voice_get_session(u32 session_id)
{
@@ -1802,6 +1811,11 @@
return ret;
}
+/**
+ * voc_disable_dtmf_det_on_active_sessions -
+ * command to disable DTMF detection for voice sessions
+ *
+ */
void voc_disable_dtmf_det_on_active_sessions(void)
{
struct voice_data *v = NULL;
@@ -1818,7 +1832,17 @@
}
}
}
+EXPORT_SYMBOL(voc_disable_dtmf_det_on_active_sessions);
+/**
+ * voc_enable_dtmf_rx_detection -
+ * command to set DTMF RX detection
+ *
+ * @session_id: voice session ID to send this command
+ * @enable: Enable or Disable detection
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_enable_dtmf_rx_detection(uint32_t session_id, uint32_t enable)
{
struct voice_data *v = voice_get_session(session_id);
@@ -1840,13 +1864,29 @@
return ret;
}
+EXPORT_SYMBOL(voc_enable_dtmf_rx_detection);
+/**
+ * voc_set_destroy_cvd_flag -
+ * set flag for destroy CVD session
+ *
+ * @is_destroy_cvd: bool value used to indicate
+ * destroy CVD session or not.
+ *
+ */
void voc_set_destroy_cvd_flag(bool is_destroy_cvd)
{
pr_debug("%s: %d\n", __func__, is_destroy_cvd);
common.is_destroy_cvd = is_destroy_cvd;
}
+EXPORT_SYMBOL(voc_set_destroy_cvd_flag);
+/**
+ * voc_alloc_cal_shared_memory -
+ * Alloc mem map table for calibration
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_alloc_cal_shared_memory(void)
{
int rc = 0;
@@ -1867,7 +1907,14 @@
return rc;
}
+EXPORT_SYMBOL(voc_alloc_cal_shared_memory);
+/**
+ * voc_alloc_voip_shared_memory -
+ * Alloc mem map table for OOB
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_alloc_voip_shared_memory(void)
{
int rc = 0;
@@ -1890,6 +1937,7 @@
return rc;
}
+EXPORT_SYMBOL(voc_alloc_voip_shared_memory);
static int is_cal_memory_allocated(void)
{
@@ -2218,6 +2266,14 @@
return ret;
}
+/**
+ * voc_update_amr_vocoder_rate -
+ * command to update AMR rate for voice session
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_update_amr_vocoder_rate(uint32_t session_id)
{
int ret = 0;
@@ -2242,6 +2298,7 @@
done:
return ret;
}
+EXPORT_SYMBOL(voc_update_amr_vocoder_rate);
static int voice_send_start_voice_cmd(struct voice_data *v)
{
@@ -5640,6 +5697,16 @@
return ret;
}
+/**
+ * voc_start_record -
+ * command to set record for voice session
+ *
+ * @port_id: Pseudo Port ID for record data
+ * @set: Enable or Disable for record start/stop
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_start_record(uint32_t port_id, uint32_t set, uint32_t session_id)
{
int ret = 0;
@@ -5774,6 +5841,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_start_record);
static int voice_cvs_start_playback(struct voice_data *v)
{
@@ -5962,6 +6030,15 @@
return ret;
}
+/**
+ * voc_start_playback -
+ * command to set playback for voice session
+ *
+ * @set: Enable or Disable for playback start/stop
+ * @port_id: Pseudo Port ID for playback data
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_start_playback(uint32_t set, uint16_t port_id)
{
struct voice_data *v = NULL;
@@ -6004,7 +6081,17 @@
return ret;
}
+EXPORT_SYMBOL(voc_start_playback);
+/**
+ * voc_disable_topology -
+ * disable topology for voice session
+ *
+ * @session_id: voice session ID to send this command
+ * @disable: disable value
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_disable_topology(uint32_t session_id, uint32_t disable)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6024,6 +6111,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_disable_topology);
static int voice_set_packet_exchange_mode_and_config(uint32_t session_id,
uint32_t mode)
@@ -6057,6 +6145,17 @@
return -EINVAL;
}
+/**
+ * voc_set_tx_mute -
+ * command to send TX mute for voice session
+ *
+ * @session_id: voice session ID to send this command
+ * @dir: RX or TX
+ * @mute: TX mute value
+ * @ramp_duration: Ramp duration in ms
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_tx_mute(uint32_t session_id, uint32_t dir, uint32_t mute,
uint32_t ramp_duration)
{
@@ -6089,7 +6188,19 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_tx_mute);
+/**
+ * voc_set_device_mute -
+ * command to set device mute for voice session
+ *
+ * @session_id: voice session ID to send this command
+ * @dir: RX or TX
+ * @mute: mute value
+ * @ramp_duration: Ramp duration in ms
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_device_mute(uint32_t session_id, uint32_t dir, uint32_t mute,
uint32_t ramp_duration)
{
@@ -6130,6 +6241,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_device_mute);
int voc_get_rx_device_mute(uint32_t session_id)
{
@@ -6151,6 +6263,15 @@
return ret;
}
+/**
+ * voc_set_tty_mode -
+ * Update tty mode for voice session
+ *
+ * @session_id: voice session ID
+ * @tty_mode: TTY mode value
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_tty_mode(uint32_t session_id, uint8_t tty_mode)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6170,7 +6291,16 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_tty_mode);
+/**
+ * voc_get_tty_mode -
+ * Retrieve tty mode for voice session
+ *
+ * @session_id: voice session ID
+ *
+ * Returns 0 on success or error on failure
+ */
uint8_t voc_get_tty_mode(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6190,7 +6320,18 @@
return ret;
}
+EXPORT_SYMBOL(voc_get_tty_mode);
+/**
+ * voc_set_pp_enable -
+ * Command to set PP for voice module
+ *
+ * @session_id: voice session ID to send this command
+ * @module_id: voice module id
+ * @enable: enable/disable flag
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_pp_enable(uint32_t session_id, uint32_t module_id, uint32_t enable)
{
struct voice_data *v = NULL;
@@ -6225,7 +6366,17 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_pp_enable);
+/**
+ * voc_set_hd_enable -
+ * Command to set HD for voice session
+ *
+ * @session_id: voice session ID to send this command
+ * @enable: enable/disable flag
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_hd_enable(uint32_t session_id, uint32_t enable)
{
struct voice_data *v = NULL;
@@ -6252,7 +6403,17 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_hd_enable);
+/**
+ * voc_set_afe_sidetone -
+ * Command to set sidetone at AFE
+ *
+ * @session_id: voice session ID to send this command
+ * @sidetone_enable: enable/disable flag for sidetone
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_afe_sidetone(uint32_t session_id, bool sidetone_enable)
{
struct voice_data *v = NULL;
@@ -6286,7 +6447,14 @@
}
return ret;
}
+EXPORT_SYMBOL(voc_set_afe_sidetone);
+/**
+ * voc_get_afe_sidetone -
+ * Retrieve sidetone status at AFE
+ *
+ * Returns sidetone enable status
+ */
bool voc_get_afe_sidetone(void)
{
bool ret;
@@ -6294,6 +6462,7 @@
ret = common.sidetone_enable;
return ret;
}
+EXPORT_SYMBOL(voc_get_afe_sidetone);
int voc_get_pp_enable(uint32_t session_id, uint32_t module_id)
{
@@ -6314,6 +6483,17 @@
return ret;
}
+/**
+ * voc_set_rx_vol_step -
+ * command to send voice RX volume in step value
+ *
+ * @session_id: voice session ID
+ * @dir: direction RX or TX
+ * @vol_step: Volume step value
+ * @ramp_duration: Ramp duration in ms
+ *
+ * Returns 0 on success or -EINVAL on failure
+ */
int voc_set_rx_vol_step(uint32_t session_id, uint32_t dir, uint32_t vol_step,
uint32_t ramp_duration)
{
@@ -6344,7 +6524,18 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_rx_vol_step);
+/**
+ * voc_set_device_config -
+ * Set voice path config for RX or TX
+ *
+ * @session_id: voice session ID
+ * @path_dir: direction RX or TX
+ * @finfo: format config info
+ *
+ * Returns 0 on success or -EINVAL on failure
+ */
int voc_set_device_config(uint32_t session_id, uint8_t path_dir,
struct media_format_info *finfo)
{
@@ -6387,7 +6578,15 @@
return 0;
}
+EXPORT_SYMBOL(voc_set_device_config);
+/**
+ * voc_set_ext_ec_ref_media_fmt_info -
+ * Update voice EC media format info
+ *
+ * @finfo: media format info
+ *
+ */
int voc_set_ext_ec_ref_media_fmt_info(struct media_format_info *finfo)
{
mutex_lock(&common.common_lock);
@@ -6404,7 +6603,18 @@
mutex_unlock(&common.common_lock);
return 0;
}
+EXPORT_SYMBOL(voc_set_ext_ec_ref_media_fmt_info);
+/**
+ * voc_set_route_flag -
+ * Set voice route state for RX or TX
+ *
+ * @session_id: voice session ID
+ * @path_dir: direction RX or TX
+ * @set: Value of route state to set
+ *
+ * Returns 0 on success or -EINVAL on failure
+ */
int voc_set_route_flag(uint32_t session_id, uint8_t path_dir, uint8_t set)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6428,7 +6638,17 @@
return 0;
}
+EXPORT_SYMBOL(voc_set_route_flag);
+/**
+ * voc_get_route_flag -
+ * Retrieve voice route state for RX or TX
+ *
+ * @session_id: voice session ID
+ * @path_dir: direction RX or TX
+ *
+ * Returns route state on success or 0 on failure
+ */
uint8_t voc_get_route_flag(uint32_t session_id, uint8_t path_dir)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6451,7 +6671,16 @@
return ret;
}
+EXPORT_SYMBOL(voc_get_route_flag);
+/**
+ * voc_end_voice_call -
+ * command to end voice call
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_end_voice_call(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6488,7 +6717,16 @@
mutex_unlock(&v->lock);
return ret;
}
+EXPORT_SYMBOL(voc_end_voice_call);
+/**
+ * voc_standby_voice_call -
+ * command to standy voice call
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_standby_voice_call(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6537,7 +6775,16 @@
fail:
return ret;
}
+EXPORT_SYMBOL(voc_standby_voice_call);
+/**
+ * voc_disable_device -
+ * command to pause call and disable voice path
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_disable_device(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6574,7 +6821,16 @@
return ret;
}
+EXPORT_SYMBOL(voc_disable_device);
+/**
+ * voc_enable_device -
+ * command to enable voice path and start call
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_enable_device(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6662,7 +6918,17 @@
return ret;
}
+EXPORT_SYMBOL(voc_enable_device);
+/**
+ * voc_set_lch -
+ * command to set hold/unhold call state
+ *
+ * @session_id: voice session ID to send this command
+ * @lch_mode: LCH mode to set
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_lch(uint32_t session_id, enum voice_lch_mode lch_mode)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6696,7 +6962,16 @@
done:
return ret;
}
+EXPORT_SYMBOL(voc_set_lch);
+/**
+ * voc_resume_voice_call -
+ * command to resume voice call
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_resume_voice_call(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6712,7 +6987,16 @@
fail:
return -EINVAL;
}
+EXPORT_SYMBOL(voc_resume_voice_call);
+/**
+ * voc_start_voice_call -
+ * command to start voice call
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_start_voice_call(uint32_t session_id)
{
struct voice_data *v = voice_get_session(session_id);
@@ -6819,7 +7103,14 @@
mutex_unlock(&v->lock);
return ret;
}
+EXPORT_SYMBOL(voc_start_voice_call);
+/**
+ * voc_set_ext_ec_ref_port_id -
+ * Set EC ref port id
+ *
+ * Returns 0 on success or -EINVAL on failure
+ */
int voc_set_ext_ec_ref_port_id(uint16_t port_id, bool state)
{
int ret = 0;
@@ -6841,7 +7132,15 @@
mutex_unlock(&common.common_lock);
return ret;
}
+EXPORT_SYMBOL(voc_set_ext_ec_ref_port_id);
+/**
+ * voc_get_ext_ec_ref_port_id -
+ * Retrieve EC ref port id
+ *
+ * Returns EC Ref port id if present
+ * otherwise AFE_PORT_INVALID
+ */
int voc_get_ext_ec_ref_port_id(void)
{
if (common.ec_ref_ext)
@@ -6849,7 +7148,18 @@
else
return AFE_PORT_INVALID;
}
+EXPORT_SYMBOL(voc_get_ext_ec_ref_port_id);
+/**
+ * voc_register_mvs_cb -
+ * Update callback info for mvs
+ *
+ * @ul_cb: Uplink callback fn
+ * @dl_cb: downlink callback fn
+ * ssr_cb: SSR callback fn
+ * @private_data: private data of mvs
+ *
+ */
void voc_register_mvs_cb(ul_cb_fn ul_cb,
dl_cb_fn dl_cb,
voip_ssr_cb ssr_cb,
@@ -6860,14 +7170,28 @@
common.mvs_info.ssr_cb = ssr_cb;
common.mvs_info.private_data = private_data;
}
+EXPORT_SYMBOL(voc_register_mvs_cb);
+/**
+ * voc_register_dtmf_rx_detection_cb -
+ * Update callback info for dtmf
+ *
+ * @dtmf_rx_ul_cb: DTMF uplink RX callback fn
+ * @private_data: private data of dtmf info
+ *
+ */
void voc_register_dtmf_rx_detection_cb(dtmf_rx_det_cb_fn dtmf_rx_ul_cb,
void *private_data)
{
common.dtmf_info.dtmf_rx_ul_cb = dtmf_rx_ul_cb;
common.dtmf_info.private_data = private_data;
}
+EXPORT_SYMBOL(voc_register_dtmf_rx_detection_cb);
+/**
+ * voc_config_vocoder -
+ * Update config for mvs params.
+ */
void voc_config_vocoder(uint32_t media_type,
uint32_t rate,
uint32_t network_type,
@@ -6882,6 +7206,7 @@
common.mvs_info.evrc_min_rate = evrc_min_rate;
common.mvs_info.evrc_max_rate = evrc_max_rate;
}
+EXPORT_SYMBOL(voc_config_vocoder);
static int32_t qdsp_mvm_callback(struct apr_client_data *data, void *priv)
{
@@ -7753,6 +8078,14 @@
return rc;
}
+/**
+ * voc_send_cvp_start_vocpcm -
+ * command to start voice hpcm
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_send_cvp_start_vocpcm(uint32_t session_id,
struct vss_ivpcm_tap_point *vpcm_tp,
uint32_t no_of_tp)
@@ -7831,7 +8164,16 @@
done:
return ret;
}
+EXPORT_SYMBOL(voc_send_cvp_start_vocpcm);
+/**
+ * voc_send_cvp_stop_vocpcm -
+ * command to stop voice hpcm
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_send_cvp_stop_vocpcm(uint32_t session_id)
{
struct cvp_command vpcm_stop_cmd;
@@ -7892,7 +8234,19 @@
done:
return ret;
}
+EXPORT_SYMBOL(voc_send_cvp_stop_vocpcm);
+/**
+ * voc_send_cvp_map_vocpcm_memory -
+ * command to map memory for voice hpcm
+ *
+ * @session_id: voice session ID to send this command
+ * @tp_mem_table: tap point memory table of hpcm
+ * paddr: Physical address of hpcm memory mapped area.
+ * bufsize: Buffer size of memory mapped area
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_send_cvp_map_vocpcm_memory(uint32_t session_id,
struct mem_map_table *tp_mem_table,
phys_addr_t paddr, uint32_t bufsize)
@@ -7902,7 +8256,16 @@
(dma_addr_t) paddr, bufsize,
VOC_VOICE_HOST_PCM_MAP_TOKEN);
}
+EXPORT_SYMBOL(voc_send_cvp_map_vocpcm_memory);
+/**
+ * voc_send_cvp_unmap_vocpcm_memory -
+ * command to unmap memory for voice hpcm
+ *
+ * @session_id: voice session ID to send this command
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_send_cvp_unmap_vocpcm_memory(uint32_t session_id)
{
int ret = 0;
@@ -7916,7 +8279,16 @@
return ret;
}
+EXPORT_SYMBOL(voc_send_cvp_unmap_vocpcm_memory);
+/**
+ * voc_send_cvp_vocpcm_push_buf_evt - Send buf event command
+ *
+ * @session_id: voice session ID to send this command
+ * @push_buff_evt: pointer with buffer event details
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_send_cvp_vocpcm_push_buf_evt(uint32_t session_id,
struct vss_ivpcm_evt_push_buffer_v2_t *push_buff_evt)
{
@@ -7979,20 +8351,41 @@
done:
return ret;
}
+EXPORT_SYMBOL(voc_send_cvp_vocpcm_push_buf_evt);
+/**
+ * voc_register_hpcm_evt_cb - Updates hostpcm info.
+ *
+ * @hostpcm_cb: callback function for hostpcm event
+ * @private_data: private data for hostpcm
+ *
+ */
void voc_register_hpcm_evt_cb(hostpcm_cb_fn hostpcm_cb,
void *private_data)
{
common.hostpcm_info.hostpcm_evt_cb = hostpcm_cb;
common.hostpcm_info.private_data = private_data;
}
+EXPORT_SYMBOL(voc_register_hpcm_evt_cb);
+/**
+ * voc_deregister_hpcm_evt_cb - resets hostpcm info.
+ *
+ */
void voc_deregister_hpcm_evt_cb(void)
{
common.hostpcm_info.hostpcm_evt_cb = NULL;
common.hostpcm_info.private_data = NULL;
}
+EXPORT_SYMBOL(voc_deregister_hpcm_evt_cb);
+/**
+ * voc_get_cvd_version - retrieve CVD version.
+ *
+ * @cvd_version: pointer to be updated with CVD version info.
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_get_cvd_version(char *cvd_version)
{
int ret = 0;
@@ -8041,6 +8434,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_get_cvd_version);
static int voice_alloc_cal_mem_map_table(void)
{
@@ -8598,6 +8992,13 @@
return ret;
}
+/**
+ * voc_set_sound_focus - sends sound focus data.
+ *
+ * @soundFocusData: sound focus data.
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_set_sound_focus(struct sound_focus_param soundFocusData)
{
struct voice_data *v = NULL;
@@ -8629,6 +9030,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_set_sound_focus);
static int voice_send_get_sound_focus_cmd(struct voice_data *v,
struct sound_focus_param *soundFocusData)
@@ -8727,6 +9129,13 @@
return ret;
}
+/**
+ * voc_get_sound_focus - retrieves sound focus data.
+ *
+ * @soundFocusData: pointer to be updated with sound focus data.
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_get_sound_focus(struct sound_focus_param *soundFocusData)
{
struct voice_data *v = NULL;
@@ -8758,6 +9167,7 @@
return ret;
}
+EXPORT_SYMBOL(voc_get_sound_focus);
static int is_source_tracking_shared_memomry_allocated(void)
{
@@ -9045,6 +9455,13 @@
return ret;
}
+/**
+ * voc_get_source_tracking - retrieves source track data.
+ *
+ * @sourceTrackingData: pointer to be updated with source track data.
+ *
+ * Returns 0 on success or error on failure
+ */
int voc_get_source_tracking(struct source_tracking_param *sourceTrackingData)
{
struct voice_data *v = NULL;
@@ -9077,13 +9494,21 @@
return ret;
}
+EXPORT_SYMBOL(voc_get_source_tracking);
+/**
+ * is_voc_initialized:
+ *
+ * Returns voice module init status
+ *
+ */
int is_voc_initialized(void)
{
return module_initialized;
}
+EXPORT_SYMBOL(is_voc_initialized);
-static int __init voice_init(void)
+int __init voice_init(void)
{
int rc = 0, i = 0;
@@ -9180,12 +9605,9 @@
return rc;
}
-device_initcall(voice_init);
-static void __exit voice_exit(void)
+void __exit voice_exit(void)
{
voice_delete_cal_data();
free_cal_map_table();
}
-
-__exitcall(voice_exit);